16.03.2017, 09:31
(
Последний раз редактировалось Sibuscus; 16.03.2017 в 11:13.
Причина: chaging title
)
I want to make a command that players can use when someone gets banned. For example, some dude gets banned, a timer gets started (RIPTimer) for 1 minute and players can do /rip, but only once and basically spam messages from everyone who uses /rip would appear on the screen with a static message. So, the point is that everyone can use this ONCE for the duration of the timer. But, for some reason I cannot script it right.
First I forward
then add this to the enums
Then I make a function that will change the player's pRIP status back to 0 when the timer is done
Here's my command. I NEED HELP HERE:
Since I'm the only one currently testing and developing the server I need a test command. This is to activate the timer to test the /rip command.
First I forward
Код:
forward RIPTimer(giveplayerid);
Код:
enum pInfo { pRIP }
Код:
public RIPTimer(giveplayerid) { PlayerInfo[giveplayerid][pRIP]==0; }
Код:
CMD:rip(playerid,params[]) { new PlayerName[MAX_PLAYER_NAME], str[128]; GetPlayerRPName(playerid, PlayerName, sizeof(PlayerName)); if(/*Need to add here to check if the RIPTimer is active*/) { if(PlayerInfo[playerid][pRIP]==0) { PlayerInfo[playerid][pRIP]==1; format(str, 128, "[BS] {} Player %s has expressed their condolences for the banned player", ); SendClientMessageToAll(COLOR_DARKCORAL, str); } } else { SendClientMessage(playerid, COLOR_DARKCORAL, "[BS] {AFAFAF}You can use this command once for a period of 1 minute after a player gets banned!"); } return 1; }
Код:
CMD:riptimer(playerid,params[]) { SetTimerEx("RIPTimer", 30000, 0, "d", i); return 1; }