29.01.2010, 03:25
I need Help I'm trying to make this command comparability to the GM Lvrcr
PS: Please Don't Say Post In That Topic Because It Never Helps
Код:
forward ResetRoadblockTimer(); forward RemoveRoadblock(playerid);
Код:
new roadblocktimer = 0;
Код:
public ResetRoadblockTimer() { roadblocktimer = 0; return 1; } public RemoveRoadblock(playerid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(Rdeploy[playerid]== 1) { DisablePlayerCheckpoint(i); } } } DestroyObject(Rdeploy[playerid]); Rdeploy[playerid] = 0; return 1; }
Код:
if(strcmp(cmdtext, "/roadblock", true)==0 || strcmp(cmdtext, "/rb", true)==0) { if (gTeam[playerid] != TEAM_COP) return SendClientMessage(playerid, COLOR_GREY, "You are not playing as a cop!"); if (Rdeploy[playerid] != 0) return SendClientMessage(playerid, COLOR_GREY, "You can only deploy 1 roadblock at a time, type /drb to remove your existing one."); if (roadblocktimer != 0) return SendClientMessage(playerid, COLOR_GREY, "Please wait before trying to spawn another roadblock!"); new Float:X, Float:Y, Float:Z, Float:A; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A); Rdeploy[playerid] == CreateObject(981, X, Y, Z, 0.0, 0.0, A+180); SetPlayerPos(playerid, X, Y, Z+4); GameTextForPlayer(playerid, "~w~Roadblock ~r~Placed", 5000, 5); SendClientMessage(playerid, COLOR_GREEN, "Roadblock deployed successfully, type /drb"); roadblocktimer == 1; } } } } SetTimer("ResetRoadblockTimer", 60000, false); return 1; } if(strcmp(cmdtext, "/drb", true)==0) { if (gTeam[playerid] != TEAM_COP) { SendClientMessage(playerid, COLOR_GREY, "You are not playing as a cop!"); return 1; } if (PlayerInfo[playerid][pRoadblock] == 0) { SendClientMessage(playerid, COLOR_GREY, "You haven't deployed a roadblock!"); return 1; } RemoveRoadblock(playerid); SendClientMessage(playerid, COLOR_GREEN, "Roadblock removed successfully."); return 1; }