if(!strcmp(cmdtext,"/m4",true)) if(gTeam[playerid] != CLASS_MERC)
{
GivePlayerWeapon(playerid, 31, 500);
return 1;
}
if(!strcmp(cmdtext,"/mp5",true)) if(gTeam[playerid] != CLASS_MERC)
{
GivePlayerWeapon(playerid, 29, 500);
return 1;
}
if(!strcmp(cmdtext,"/sniper",true)) if(gTeam[playerid] != CLASS_MERC)
{
GivePlayerWeapon(playerid, 34, 100);
return 1;
}
if(!strcmp(cmdtext,"/rpg",true)) if(gTeam[playerid] != CLASS_MERC)
{
GivePlayerWeapon(playerid, 35, 50);
return 1;
}
if(!strcmp(cmdtext,"/grenades",true)) if(gTeam[playerid] != CLASS_MERC)
{
GivePlayerWeapon(playerid, 16, 50);
return 1;
}
if(!strcmp(cmdtext,"/gas",true)) if(gTeam[playerid] != CLASS_MERC)
{
GivePlayerWeapon(playerid, 17, 50);
return 1;
}
if(!strcmp(cmdtext,"/shot",true)) if(gTeam[playerid] != CLASS_MERC)
{
GivePlayerWeapon(playerid, 27, 500);
return 1;
}
if(!strcmp(cmdtext,"/knife",true)) if(gTeam[playerid] != CLASS_MERC)
{
GivePlayerWeapon(playerid, 4, 1);
return 1;
}
new SpamProtection[MAX_PLAYERS];
SpamProtection[playerid] = 0;
SpamProtection++;
if(SpamProtection == 3) return // ----> (SetTimerEx here, or what ever you want)
SetTimer("NoSpam",20000,1);
forward NoSpam();
public NoSpam()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(SpamProtection[i] > 0)
{
SpamProtection[i] = 0;
}
}
}
}
SpamProtection++;
if(SpamProtection == 3) return SendClientMessage(playerid, COLOR_GREEN, "SERVER: Hey, wait a few seconds, spammy boi C:");
.
|
Top of your script:
pawn Код:
pawn Код:
pawn Код:
----------- If you want it my way: OnGameModeInit: pawn Код:
pawn Код:
pawn Код:
------------ For the weapon thingy, if you want to make it smaller, use dialogs or strtok/tmp . |
|
Dude this is Spam Protection...I want my** code in one and a timer for it so thay can only get a weapon every 2 mins..
|
|
Dude this is Spam Protection...I want my** code in one and a timer for it so thay can only get a weapon every 2 mins..
|
.