12.06.2015, 19:33
I make the command:
And i put this OnPLayerEnterCheckpoint
BUT when i enter in checkpoint not give me money and not disable checkpoint, why? PLS
PHP код:
CMD:work(playerid,params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai.");
if(PlayerInfo[playerid][pJob] != 14) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not a Trucker.");
if(!IsPlayerInRangeOfPoint(playerid, 10.0, -146.3690,-1116.3546,4.2725)) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not the place where you can get products.");
new Trucker = CreateVehicle(515,-142.5756,-1116.7383,5.3989,257.1702,3,77,-1); // Trucker si remorca
new TrailerID = CreateVehicle(450,-152.0133,-1114.9786,5.9868,258.3351,3,77,-1); // Trucker si remorca
AttachTrailerToVehicle(TrailerID,GetPlayerVehicleID(playerid));
PutPlayerInVehicle(playerid,Trucker,0);
SetPlayerCheckpoint(playerid,-96.4776,-1159.1644,2.0905,4.0);
IsTruckerStart[playerid] = 1;
return 1;
}
PHP код:
else if(IsTruckerStart[playerid] == 1 && ccar && IsATruck(tmpcar))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
DisablePlayerCheckpoint(playerid);
new randtrucker = 30000 + random(20000);
format(string,sizeof(string),"{FFFF00}You received %s$ for your work.",FormatNumber(randtrucker));
SCM(playerid,COLOR_WHITE,string);
GivePlayerCash(playerid,randtrucker);
Update(playerid, pCashx);
}
else return SendClientMessage(playerid,COLOR_YELLOW,"Where is the Trailer? ");
}