03.07.2012, 20:28
Quote:
Create one variable and set for the command, example:
pawn Код:
|
Код:
CMD:pirate(playerid, params[]) { pirated[playerid] = 1; { if(pirated[playerid] == 0) return SendClientMessage(playerid, -1, "You created the ship, please use /removeship"); new Float:x,Float:y,Float:z,Float:a; GetPlayerPos(playerid,x,y,z); GetPlayerFacingAngle(playerid,a); piratev[playerid] = CreateVehicle(484,x+3,y+3,z,a,1,1,10000); pirateo[playerid] = CreateObject(8493, 0.195679, 0.113892, -10.283400, 0.0, 0.0, 96.0); LinkVehicleToInterior(piratev[playerid], 10); PutPlayerInVehicle(playerid, piratev[playerid], 0); AttachObjectToVehicle(pirateo[playerid], piratev[playerid], 7.0, 0.0, 16.0, 0.0, 0.0, 0.0); SendClientMessage(playerid, COLOR_YELLOW, "To remove the piratefun do /pirateremove.!"); return 1; } }
Код:
//=====================[PIRATE REMOVE]========================================== CMD:pirateremove(playerid, params[]) { pirated[playerid] = 0; RemovePlayerFromVehicle(playerid); DestroyObject(pirateo[playerid]); DestroyVehicle(piratev[playerid]); GameTextForPlayer(playerid, "~g~Succsessfully destroyed",10000,5); return 1; }