27.09.2015, 10:52
Quote:
Can someone tell me why if i enter the checkpoint i get the message: "Someone is already planting the bomb" but i can plant it however?
Код:
public OnPlayerEnterCheckpoint(playerid) { if(gTeam[playerid] == TEAM_DEFENDERS) { GameTextForPlayer(playerid,"~w~Defend this bomb checkpoint from ~b~terrorists!",5000,4); } else if(gTeam[playerid] == TEAM_TERRORISTS) { if(AlreadyPlanting[playerid] == 1) { SendClientMessage(playerid, -1, "* Someone is already planting the {F2C80C}bomb, {FFFFFF}please wait."); return 0; } if(Planted[playerid] == 1) { SendClientMessage(playerid, -1, "* The {F2C80C}bomb {FFFFFF}has been planted already and it will explode soon."); return 0; } new name[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "~r~%s ~w~will plant the ~r~bomb ~w~in 15 seconds!",name); GameTextForAll(string,5000,4); BombTimer = SetTimer("Explode",15000,false); AlreadyPlanting[playerid] = 1; } return 1; } |
You might want to check the AlreadyPlanting[playerid] == 1 and loop through all players and check if they're planting.