Hey...
Ich habe schon seit ein paar Tagen ein Problem...
Wenn ich in meinem Code :
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerInVehicle(playerid, 515), SendClientMessage(playerid,0x00FF00AA," Du bist in einem Truck..."))
return 1;
}
return 0;
}
Der sollte eigentlich funzen da es beim Compilen keine Probs gibt..
Also ich möchte gerne das man sich ein bisschen geld nebenbei verdienen kann,
und deswegen hab ich einen Truckplatz errichted und wenn man in einen Truck einsteigt soll stehen :
Drücke /truckstarten um den Truck zu starten und die CP'S abzufahren...
Ja und wenn er aber in ein Car mit der ID 515 einsteigt
kommt nix...
Noch besser wärs sogar das man Autos bezeichnet, sodass wenn ein Player in einen anderen Truck
einsteigt nix kjommt aber wenn er z.B. in den Truck mit dem Namen ,,Jobtruck''
einsteigt das dann ein GameText kommt : "Trcuker Mission starten ~n~ ~g~ /truckstarten
ICH BITTE UM HILFE...!
Hier mein ganzer Kleiner Filterscript:
#include <a_samp>
#define COLOR_LIGHTGREEN 0x86FF59FF
#define COLOR_RED 0xFF0000FF
#define COLOR_GREEN 0x00CA00FF
enum e_PlayerTruckerInfo {
bool:pmi_bAktiv,
pmi_Checkpoint
}
new Trucker[MAX_PLAYERS][e_PlayerTruckerInfo];
enum e_Muell {
Float:M_fX,
Float:M_fY,
Float:M_fZ,
Float:M_fRad,
M_Msg[128]
}
new
Trucker_Stationen[][e_Muell] = {
{2157.4709,-2130.7424,14.3551, 6.0,"1/42"},//check01
{2268.9189,-2238.6057,14.6647, 6.0,"2/42"},//check02
{2235.6892,-2315.0598,14.3940, 6.0,"3/42"},//check03
{2156.9443,-2505.3601,14.3937, 6.0,"4/42"},//check04
{2072.7505,-2668.0027,14.3972, 6.0,"5/42"},//check05
{1586.2463,-2669.9971,6.9606, 6.0,"6/42"},//check06
{1347.1021,-2539.6831,14.3941, 6.0,"7/42"},//check07
{1484.6213,-2133.7561,14.6055, 6.0,"8/42"},//check08
{1643.5338,-1880.2450,26.0994, 6.0,"9/42"},//check09
{1665.9006,-1555.3400,25.4120, 6.0,"10/42"},//check10
{1917.5189,-1516.7356,4.2880, 6.0,"11/42"},//check11
{2184.0723,-1562.8816,3.1900, 6.0,"12/42"},//check12
{2459.7917,-1621.8210,16.3724, 6.0,"13/42"},//check13
{2711.3459,-1623.9640,14.0542, 6.0,"14/42"},//check14
{2826.0637,-1661.4208,11.7894, 6.0,"15/42"},//check15
{2925.1816,-1500.1879,11.8990, 6.0,"16/42"},//check16
{2892.0547,-947.3284,10.5348, 6.0,"17/42"},//check17
{2892.0547,-947.3284,10.5348, 6.0,"18/42"},//check18
{2895.8491,-611.7032,10.5697, 6.0,"19/42"},//check19
{2851.7017,-429.3421,8.8435, 6.0,"20/42"},//check20
{2799.5305,-265.1689,9.3651, 6.0,"21/42"},//check21
{2874.1858,-102.6594,22.2731, 6.0,"22/42"},//check22
{2673.1702,48.0963,25.1561, 6.0,"23/42"},//check23
{2404.9329,43.2476,25.9915, 6.0,"24/42"},//check24
{2365.6677,93.9184,26.1029, 6.0,"25/42"},//check25
{2300.4211,68.1175,26.1422, 6.0,"Erste Ladung beim Clunkin' Bell abgeladen..."},//Clunkin' Bell Stop 1
//Neue Checkpoints
{2224.9126,93.7552,27.3548, 6.0,"27/42"},//check27
{2292.4741,109.1481,27.3836, 6.0,"28/42"},//check28
{2347.0542,141.2868,27.3549, 6.0,"29/42"},//check29
{2346.3313,270.3561,27.3579, 6.0,"30/42"},//check30
{2400.9768,290.7039,32.1461, 6.0,"31/42"},//check31
{2678.3477,294.5206,40.6353, 6.0,"32/42"},//check32
{2760.6995,28.2515,31.7202, 6.0,"33/42"},//check33
{2710.5422,-239.1258,30.7936, 6.0,"34/42"},//check34
{2874.2925,-752.6071,11.8546, 6.0,"35/42"},//check35
{2869.1538,-1174.7383,11.8955, 6.0,"36/42"},//check36
{2857.0051,-1650.5431,11.8810, 6.0,"37/42"},//check37
{2756.8770,-1655.8066,13.5410, 6.0,"38/42"},//check38
{2574.1038,-1730.9148,14.4019, 6.0,"39/42"},//check39
{2424.6953,-1730.0466,14.5818, 6.0,"40/42"},//check40
{2411.4819,-1855.9585,14.4014, 6.0,"41/42"},//check41
{2392.6306,-1890.3711,14.3947, 6.0,"Good Job, Die 900$ werden auf dein Konto aufgezahlt..."} //Clunkin' Bell Stop 2
};
public OnFilterScriptInit()
{
print("Trucker Job");
//Pulls (Trucks)
CreateVehicle(515, 2116.2180175781, -2130.5354003906, 14.786533355713, 270.27026367188,1,1,-1);//Zugmaschiene1
CreateVehicle(515, 2116.2514648438, -2137.1696777344, 14.786533355713, 270.26916503906,1,1,-1);//Zugmaschiene2
CreateVehicle(515, 2115.7746582031, -2144.8937988281, 14.786533355713, 270.26916503906,1,1,-1);//Zugmaschiene3
CreateVehicle(515, 2154.3937988281, -2141.2763671875, 14.700595855713, 49.848876953125,1,1,-1);//Zugmaschiene4
CreateVehicle(515, 2150.6372070313, -2145.8793945313, 14.700595855713, 49.844970703125,1,1,-1);//Zugmaschiene5
CreateVehicle(515, 2145.048828125, -2151.0864257813, 14.700595855713, 9.9649658203125,1,1,-1);//Zugmaschiene6
//Trailer (Aufleger)
CreateVehicle(435, 2126.5, -2155.1179199219, 14.600073814392,0,0,1,-1);//Trailer1
CreateVehicle(450, 2132.8315429688, -2155.0727539063, 14.600073814392,0,1,1,-1);//Trailer2
CreateVehicle(584, 2139.3002929688, -2154.4445800781, 14.600073814392,0,1,1,-1);//Trailer3
CreateVehicle(435, 2133.3198242188, -2092.3774414063, 14.600073814392, 140.66040039063,0,1,-1);//Trailer4
CreateVehicle(450, 2125.1264648438, -2085.3447265625, 14.600073814392, 140.65795898438,1,1,-1);//Trailer5
CreateVehicle(584, 2116.9797363281, -2078.5100097656, 14.607569694519, 140.65795898438,1,1,-1);//Trailer6
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
if (strcmp("/truckstarten", cmdtext, true, 8) == 0) {
if(!Trucker[playerid][pmi_bAktiv]) {
new
vehicleid = GetPlayerVehicleID(playerid),
model = GetVehicleModel(vehicleid);
if(model == 515) {
Trucker[playerid][pmi_Checkpoint]=0;
Trucker[playerid][pmi_bAktiv]=true;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "Truck gestarted, schnapp dir deinen Trailer und geh auf Tour...");
SetPlayerCheckpoint(playerid,Trucker_Stationen[0][M_fX],Trucker_Stationen[0][M_fY],Trucker_Stationen[0][M_fZ],Trucker_Stationen[0][M_fRad]);
}
else {
SendClientMessage(playerid, COLOR_RED, "Du bist nicht in einem Truck");
}
}
else {
SendClientMessage(playerid, COLOR_RED, "Es läuft bereits eine Truckfahrt");
}
return 1;
}
if(strcmp("/test", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,2157.4709,-2130.7424,14.3551);
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[INFO]:Beim TestPort !!");
return 1;
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(Trucker[playerid][pmi_bAktiv]) {
Trucker[playerid][pmi_Checkpoint]++;
DisablePlayerCheckpoint(playerid);
new
playercp = Trucker[playerid][pmi_Checkpoint];
if(playercp == sizeof(Trucker_Stationen)) {
Trucker[playerid][pmi_bAktiv]=false;
// Ne einfache Message
SendClientMessage(playerid, COLOR_GREEN, "Good Job, die 800$ werden auf dein Konto aufgezehlt");
GivePlayerMoney(playerid, 900);
SetVehicleToRespawn(515);
SetVehicleToRespawn(435);
SetVehicleToRespawn(450);
SetVehicleToRespawn(584);
}
else {
new
String[128];
PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
format(String,sizeof(String),">>(%d / %d)",playercp,sizeof(Trucker_Stationen));
SendClientMessage(playerid,COLOR_LIGHTGREEN,String);
SetPlayerCheckpoint(playerid,Trucker_Stationen[playercp][M_fX],Trucker_Stationen[playercp][M_fY],Trucker_Stationen[playercp][M_fZ],Trucker_Stationen[playercp][M_fRad]);
}
return 1;
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerInVehicle(playerid, 515), SendClientMessage(playerid,0x00FF00AA," Du bist in einem Truck..."))
return 1;
}
return 0;
}
Alles anzeigen
Bitte um Hilfe
MfG Bene