/name command error - 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: /name command error (
/showthread.php?tid=335946)
/name command error -
HazardGaming - 20.04.2012
Can someone tell me what's wrong with this CMD?
Код:
CMD:name(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] >= 1)
{
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xE60000FF, "Warning: {FFFFFF} /name [playerid]");
if(targetid == playerid) return SendClientMessage(playerid, 0xE60000FF, "Warning: {FFFFFF}You cannot kick yourself!");
If(PlayerInfo[playerid][pAdminLevel] > PlayerInfo[playerid][pAdminLevel]) return SendClientMessage(playerid, 0xE60000FF, "Warning: {FFFFFF} You cannot kick a higher administrator!");
else
{
new string[128];
format(string, sizeof(string), "AdmLog: Administrator %s has just kicked %s, reason: Non RP Name!", GetName(playerid), GetName(targetid));
Kick(targetid);
}
return 1;
}
I get these errors:
Код:
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Untitled.pwn(96) : error 017: undefined symbol "UserPath"
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Untitled.pwn(98) : error 017: undefined symbol "UserPath"
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Untitled.pwn(113) : error 017: undefined symbol "UserPath"
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Untitled.pwn(122) : error 017: undefined symbol "UserPath"
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Untitled.pwn(286) : error 079: inconsistent return types (array & non-array)
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Untitled.pwn(287) : error 079: inconsistent return types (array & non-array)
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Untitled.pwn(288) : error 017: undefined symbol "If"
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Untitled.pwn(288) : error 001: expected token: ";", but found "return"
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Untitled.pwn(288) : error 079: inconsistent return types (array & non-array)
C:\Users\Elmo\Desktop\SAMP Project\gamemodes\Untitled.pwn(288) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
10 Errors.
Re: /name command error -
nilanjay - 20.04.2012
pawn Код:
CMD:name(playerid, params[])
{
if(PlayerInfo[playerid][pAdminLevel] >= 1)
{
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xE60000FF, "Warning: {FFFFFF} /name [playerid]");
if(targetid == playerid) return SendClientMessage(playerid, 0xE60000FF, "Warning: {FFFFFF}You cannot kick yourself!");
If(PlayerInfo[playerid][pAdminLevel] > PlayerInfo[playerid][pAdminLevel]) return SendClientMessage(playerid, 0xE60000FF, "Warning: {FFFFFF} You cannot kick a higher administrator!");
else
{
new string[128];
format(string, sizeof(string), "AdmLog: Administrator %s has just kicked %s, reason: Non RP Name!", GetName(playerid), GetName(targetid));
Kick(targetid);
}// you forgot this
}
return 1;
}
Re: /name command error -
HazardGaming - 20.04.2012
Thanks so much, I keep forgetting stuff like that.. Repped++.