public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerWeapon(killerid) == 38)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, -1, "{FF0000}%s has been reported automatically by the server[Reason: Minigun], Advice: Spec", killerid);
}
else
{
if(IsPlayerConnected(killerid)) return SendClientMessage(i, -1, "{FF0000}WARNING: %s HAS LEFT THE SERVER", killerid);
}
}
}
return 1;
}
C:\Users\yan\Desktop\Scripting tests\filterscripts\antimini.pwn(22) : warning 202: number of arguments does not match definition C:\Users\yan\Desktop\Scripting tests\filterscripts\antimini.pwn(26) : warning 202: number of arguments does not match definition C:\Users\yan\Desktop\Scripting tests\filterscripts\antimini.pwn(30) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Warnings.
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerWeapon(killerid) == 38)
{
foreach(new i: Player)
{
if(IsPlayerAdmin(i))
{
new string[110];
format(string, sizeof(string), "{FF0000}%s has been reported automatically by the server[Reason: Minigun], Advice: Spec", killerid);
SendClientMessage(i, -1, string);
}
else
{
if(IsPlayerConnected(killerid)) return SendClientMessage(i, -1, "{FF0000}WARNING: %s HAS LEFT THE SERVER", killerid);
}
}
}
return 1;
}
You can't format strings like that.
https://sampwiki.blast.hk/wiki/Format Also, use foreach for player loops. pawn Код:
|
SendClientMessage(i, -1, "{FF0000}WARNING: %s HAS LEFT THE SERVER", killerid);
Same goes for his other line
pawn Код:
|
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(GetPlayerWeapon(playerid) == 38)
{
foreach(new i: Player)
{
if(IsPlayerAdmin(i))
{
new string [128];
format(string, sizeof(string), "{FF0000}ATTENTION: The server has automatically reported %s for using minigun, He has to be spectated", playerid);
SendClientMessage(i, -1, string);
}
else
{
new string [128];
if(IsPlayerConnected(playerid)) return format(string, sizeof(string), "{FF0000}ATTENTION: %s HAS LEFT THE SERVER!", playerid);
}
}
}
return 1;
}
else
{
new string [128];
if(IsPlayerConnected(playerid)) return format(string, sizeof(string), "{FF0000}ATTENTION: %s HAS LEFT THE SERVER!", playerid);
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(GetPlayerWeapon(playerid) == 38)
{
foreach(new i: Player)
{
if(IsPlayerAdmin(i))
{
if( i != playerid )
{
new name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "{FF0000}ATTENTION: The server has automatically reported %s for using minigun, He has to be spectated", name);
SendClientMessage(i, -1, string);
}
}
}
}
return 1;
}