Quote:
Originally Posted by Misiur
Nah, you don't beg for complete script so I'll be glad to help.
First of all, watch your braces ( https://sampwiki.blast.hk/wiki/Control_Structures#if )
pawn Код:
CMD:dropcar(playerid, params[]) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not in a vehicle!"); SetPlayerCheckpoint(playerid, -1697.0311,-92.7514,3.5544, 5.0); //IsPlayerInAnyVehicle(playerid) is redundant, as we've checked it on top of function return 1; } SuccessMission(playerid) { GivePlayerMoney(playerid, random(1000) + 657); SetVehicleToRespawn(playerid); SendClientMessage(playerid, COLOR_WHITE, "You dopped a car! You must now wait 15 minutes before doing this command again."); DisablePlayerCheckpoint(playerid); } public OnPlayerEnterCheckpoint(playerid) { if(IsPlayerInRangeOfPoint(playerid, 5, -1697.0311,-92.7514,3.5544)) { if(IsPlayerInAnyVehicle(playerid)) { SuccessMission(playerid); //GetPlayerVehicleID returns id of car in which player is currently in. It doesn't check if he's driver though SetVehicleToRespawn(GetPlayerVehicleID(playerid)); } } return 1; }
|
Awesome! Thank you so much. And I will be more careful in the future with my braces.