[Solved] /countdown
#1

Does anyone know a simple coundown code?
And why It doesnt show : Unknown command when I type wrong commands?
Reply
#2

the callback OnPlayerCommandText must return 0 (false) to show the message "SERVER: Unknown Command" when an incorrect command has been typed.
Reply
#3

Search
Reply
#4

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "/commands");
return 0;
}
if (strcmp("/commands", cmdtext, true, 10) == 0)

{ SendClientMessage(playerid, COLOR_ORANGE, "General commans");
SendClientMessage(playerid, COLOR_YELLOW, "/register, /mystats, /report,");
SendClientMessage(playerid, COLOR_YELLOW, "/fc 0, /fc 1, /nos");

SendClientMessage(playerid, COLOR_ORANGE, "Administrator commands");
SendClientMessage(playerid, COLOR_YELLOW, "/nuke, /fetch, /sethealth, /setarmour, /givecash, /banip");
SendClientMessage(playerid, COLOR_YELLOW, "/tempmod, /tempadmin, /giveweapon,");

SendClientMessage(playerid, COLOR_ORANGE, "Moderator commands");
SendClientMessage(playerid, COLOR_YELLOW, "/unban, /unbanip, /tp, /kill2, /refill, /ban, /kick, ");
SendClientMessage(playerid, COLOR_YELLOW, "/mute, /unmute, /vr, /spawn, /fix, /flip, /respawn, /tpmenu");
SendClientMessage(playerid, COLOR_YELLOW, "/spec, /specoff, /vcolour, /jail, /unjail ");
return 0;
}
if (strcmp("/fc 0", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "Done.Now youre fighting on main club");
SetPlayerPos(playerid,2094.7195,2189.5349,13.5967) ;

return 1;
}
if (strcmp("/fc 1", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "Now youre fighting on club 1");
SetPlayerPos(playerid,2010.7167,2168.5371,13.8421) ;

return 0;

}
return 0;
}
Reply
#5

done, now... Does anyone knows any /countdown code?
Reply
#6

http://pastebin.com/m100501
Reply
#7

Quote:
Originally Posted by lrZ^ aka LarzI
Thank you it works, but why if I type two or more times /count , the countdown doesnt stop?
Reply
#8

if(counter != 0)

that line prevents the countdown to start, if it has already started...
Or at least it should
Reply
#9

so how to avoid repeating countdown, i want to make it available only from 10 seconds.
Reply
#10

like a countdown from 10?
easy, just do like I've did in the timer function :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)