SA-MP Forums Archive
use command 1x... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: use command 1x... (/showthread.php?tid=194032)



use command 1x... - Baboon - 28.11.2010

hi there!, here is a little script.

Quote:

if(!strcmp(cmdtext, "/help"))
{
SendClientMessage(playerid,WHITE,"--------HELP-----------------------");
SendClientMessage(playerid,GREEN,"This is a Team Death Match gameplay. You are in a fight between Vietnam and USA, have Fun. We now have killstreaks.");
SendClientMessage(playerid,WHITE,"--------HELP-----------------------");
return 1;
}

How can I make it that you can only use /help once? That it disables after?


Re: use command 1x... - WillyP - 28.11.2010

Variables/PVars.

This forum requires that you wait 120 seconds between posts. Please try again in 31 seconds.


Re: use command 1x... - Baboon - 28.11.2010

Can you give me an example? Thanks.

Then: you get a message: Sorry, you already have used this command.


Re: use command 1x... - WillyP - 28.11.2010

Top of code:

pawn Код:
new usedhelp[MAX_PLAYERS] = 0;
OnPlayerConnect

pawn Код:
usedhelp[playerid] = 0;
OnPlayerCommandText

pawn Код:
if(!strcmp(cmdtext, "/help"))
{
if(usedhelp[playerid] == 1) return SendClientMessage(playerid,COLOR_yourcolourhere,"You are NOT allowed to use this command!");
SendClientMessage(playerid,WHITE,"--------HELP-----------------------");
SendClientMessage(playerid,GREEN,"This is a Team Death Match gameplay. You are in a fight between Vietnam and USA, have Fun. We now have killstreaks.");
SendClientMessage(playerid,WHITE,"--------HELP-----------------------");
usedhelp[playerid] = 1;
return 1;
}



Re: use command 1x... - Baboon - 28.11.2010

let emt ry it, thanks.