SA-MP Forums Archive
Undefined symbol "playerid" - 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: Undefined symbol "playerid" (/showthread.php?tid=395745)



Undefined symbol "playerid" - NicholasA - 27.11.2012

Hi when i try compiling my script it comes with this error:
Код:
C:\Users\x3990.003\Desktop\samp server\filterscripts\Untitled.pwn(32) : error 017: undefined symbol "playerid"
C:\Users\x3990.003\Desktop\samp server\filterscripts\Untitled.pwn(33) : error 017: undefined symbol "playerid"
C:\Users\x3990.003\Desktop\samp server\filterscripts\Untitled.pwn(39) : error 017: undefined symbol "playerid"
C:\Users\x3990.003\Desktop\samp server\filterscripts\Untitled.pwn(40) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
PLEASE HLEP MEEEWWWW!!!


Re: Undefined symbol "playerid" - Jarnu - 27.11.2012

Show us the line! line 32 33 39 and 40 and the call back under which you have put those lines


Re: Undefined symbol "playerid" - [KHK]Khalid - 27.11.2012

You have to show those lines (32, 33, 39 and 40).


Re: Undefined symbol "playerid" - NicholasA - 27.11.2012

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
Show us the line! line 32 33 39 and 40 and the call back under which you have put those lines
Here you go

Код:
public OnRconCommand(cmd[])
{
    if(!strcmp(cmd,"/god",true))
    {
   		SendClientMessageToAll(0xDEEE20FF, "An admin has enabled his GODMODE!");
    	SetPlayerHealth(playerid, 9999999999999999999999);
    	SetPlayerArmour(playerid, 9999999999999999999999.0);
        return 1;
	}
	if(!strcmp(cmd,"/ungod",true))
    {
   		SendClientMessageToAll(0xDEEE20FF, "An admin has disabled his GODMODE!");
    	SetPlayerHealth(playerid, 100);
    	SetPlayerArmour(playerid, 0.0);
    }
    return 0;
}
Dont laugh at me please, im a beginner


Re: Undefined symbol "playerid" - [HK]Ryder[AN] - 27.11.2012

this will not work because playerid is not there in the callback..
you ahd rather create this command using your normal command processor and then before the command check if player is admin or not using if(!IsPlayerAdmin(playerid))

example -
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/god", true))
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "you are not an admin");
        SendClientMessageToAll(0xDEEE20FF, "An admin has enabled his GODMODE!");
        SetPlayerHealth(playerid, 9999999999999999999999);
        SetPlayerArmour(playerid, 9999999999999999999999.0);
        return 1;
       
    }
if(!strcmp(cmd,"/ungod",true))
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "you are not an admin");  
    SendClientMessageToAll(0xDEEE20FF, "An admin has disabled his GODMODE!");
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 0.0);
    }
    return 0;
   
}



Re: Undefined symbol "playerid" - Raximax - 27.11.2012

Reduce down the 9's to 9999999, There are too many, I think thats what the problem is


Re: Undefined symbol "playerid" - NicholasA - 27.11.2012

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
this will not work because playerid is not there in the callback..
you ahd rather create this command using your normal command processor and then before the command check if player is admin or not using if(!IsPlayerAdmin(playerid))
i really dont get this.. whats the correct format to use when trying to create a new rcon command?


Re: Undefined symbol "playerid" - Jarnu - 27.11.2012

You're wrong Raxi. don't post if you don't know what you're talking about.

Anyway. as ryder said already. there is no "playerid" parameter in this callback.


Re: Undefined symbol "playerid" - NicholasA - 27.11.2012

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
You're wrong Raxi. don't post if you don't know what you're talking about.

Anyway. as ryder said already. there is no "playerid" parameter in this callback.
could you show me the correct format?


Re: Undefined symbol "playerid" - Raximax - 27.11.2012

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
You're wrong Raxi. don't post if you don't know what you're talking about.

Anyway. as ryder said already. there is no "playerid" parameter in this callback.
I was wrong in one sense, but once he goes ingame and types that command he will just die, he already mentioned the callback so there was no point for me to do it? haha