I dont want people to spam some commands
#1

Well i did /nrg command to spawn you NRG-500, but people are spamming it....Is there any idea so it cant be spammed, and doesnt respawn again
Reply
#2

Quote:
Originally Posted by MartinDaniel
Well i did /nrg command to spawn you NRG-500, but people are spamming it....Is there any idea so it cant be spammed, and doesnt respawn again
post your command and ill add it in for you.
Reply
#3

Here it is:

Код:
	if (strcmp("/nrg", cmdtext, true, 10) == 0)
	{
		new Float: X, Float: Y, Float: Z, Float: A;
		GetPlayerPos(playerid,X,Y,Z);
		GetPlayerFacingAngle(playerid,A);
		new car = CreateVehicle(522,X,Y,Z,A,-1,-1,120000);
		PutPlayerInVehicle(playerid,car,0);
		return 1;
	}
Reply
#4

pawn Код:
new Spawned[MAX_PLAYERS];//global varible
pawn Код:
Spawned[playerid] = 0;// add under onplayerconnect
pawn Код:
if (strcmp("/nrg", cmdtext, true, 10) == 0)
{
if(Spawned[playerid] == 1)
{
SendClientMessage(playerid, yourcolor, " You already spawned a nrg500");
retrun 1;
}
        new Float: X, Float: Y, Float: Z, Float: A;
        GetPlayerPos(playerid,X,Y,Z);
        GetPlayerFacingAngle(playerid,A);
        new car = CreateVehicle(522,X,Y,Z,A,-1,-1,120000);
        PutPlayerInVehicle(playerid,car,0);
             Spawned[playerid] = 1;
        return 1;
    }
not tested should work tho
Reply
#5

Should be return 1; not retrun 1;
Reply
#6

I got 4 errors:
C:\Documents and Settings\Medo\Desktop\SA-MP Server\gamemodes\stuntscript.pwn(163) : error 017: undefined symbol "Spawned"
C:\Documents and Settings\Medo\Desktop\SA-MP Server\gamemodes\stuntscript.pwn(163) : warning 215: expression has no effect
C:\Documents and Settings\Medo\Desktop\SA-MP Server\gamemodes\stuntscript.pwn(163) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Medo\Desktop\SA-MP Server\gamemodes\stuntscript.pwn(163) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Medo\Desktop\SA-MP Server\gamemodes\stuntscript.pwn(163) : fatal error 107: too many error messages on one line

Error line 163: Spawned[playerid] = 0;
Reply
#7

Hello guys, any idea ?


Sorry for the double post
Reply
#8

did you add this at the top of your script new Spawned[MAX_PLAYERS];
Reply
#9

It works now, thanks
Reply
#10

Quote:
Originally Posted by MartinDaniel
It works now, thanks
np any time
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)