Warn command errors... - 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)
+--- Thread: Warn command errors... (
/showthread.php?tid=351891)
Warn command errors... -
Audi_Quattrix - 17.06.2012
Command:
pawn Код:
CMD:warn(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid) || PlayerInfo[playerid][pVip] >= 3)
{
{
new targetid, reason;
new Name[MAX_PLAYER_NAME];
new Name1[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
GetPlayerName(targetid, Name1, MAX_PLAYER_NAME);
if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /warn [playerid] [reason]");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Warn Yourself!");
}
else
{
new str[128];
format(str, sizeof(str), "Administrator %s Has Warned %s Reason: %d!", Name, Name1, reason);
SendClientMessageToAll(COLOR_DRED,str);
Warns[targetid] ++;
}
}
}
Errors:
pawn Код:
C:\Users\asus\Desktop\Server 0.3e\gamemodes\Stunt.pwn(2900) : error 029: invalid expression, assumed zero
C:\Users\asus\Desktop\Server 0.3e\gamemodes\Stunt.pwn(2903) : error 017: undefined symbol "Name"
C:\Users\asus\Desktop\Server 0.3e\gamemodes\Stunt.pwn(2905) : error 017: undefined symbol "targetid"
C:\Users\asus\Desktop\Server 0.3e\gamemodes\Stunt.pwn(2908) : warning 209: function "cmd_warn" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
Line 2903:
pawn Код:
format(str, sizeof(str), "Administrator %s Has Warned %s Reason: %d!", Name, Name1, reason);
Re: Warn command errors... -
ViniBorn - 17.06.2012
pawn Код:
CMD:warn(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid) || PlayerInfo[playerid][pVip] >= 3)
{
//new reason[32];
if(sscanf(params, "rs[32]", targetid, reason))
return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /warn [playerid] [reason]");
if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Warn Yourself!");
new str[128],targetid, reason,Name[MAX_PLAYER_NAME],Name1[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
GetPlayerName(targetid, Name1, MAX_PLAYER_NAME);
format(str, sizeof(str), "Administrator %s Has Warned %s Reason: %d!", Name, Name1, reason);
SendClientMessageToAll(COLOR_DRED,str);
Warns[targetid] ++;
}
return true;
}