SA-MP Forums Archive
i need help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: i need help (/showthread.php?tid=266313)



i need help - ssKiller - 04.07.2011

Code:
public OnPlayerConnect(playerid)
{
new string[254];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername)); //Gets the name + string
format(string, sizeof(string),"%s has signed as Admin",playername); // formats the string
if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]
SendClientMessageToAll(0x33FF33AA, string);//It will send the message above


And i get this error:

C:\Users\Javon\Desktop\My Server\filterscripts\ladmin4v2.pwn(696) : error 017: undefined symbol "player1"
C:\Users\Javon\Desktop\My Server\filterscripts\ladmin4v2.pwn(723) : error 021: symbol already defined: "string"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

it ladmin


Re: i need help - Lorenc_ - 04.07.2011

Replace 'player1' with 'playerid'

and delete the string variable


Re: i need help - JaTochNietDan - 04.07.2011

The errors are quite obvious! You have already created a variable named "string" in a higher scope than this and you have not defined "player1", so of course there are going to be problems.

I recommend you read the PAWN manual over at Compuphase's website.


Re: i need help - ssKiller - 04.07.2011

now

C:\Users\Javon\Desktop\My Server\filterscripts\ladmin4v2.pwn(697) : error 001: expected token: ")", but found "-identifier-"
C:\Users\Javon\Desktop\My Server\filterscripts\ladmin4v2.pwn(1050) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: i need help - Mean - 04.07.2011

Post your new code? Really, learn some basics, and I wonder how you got that 1 reputation.


Re: i need help - ssKiller - 04.07.2011

new string[254];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername)); //Gets the name + string
format(string, sizeof(string),"%s has signed as Admin",playername); // formats the string
if(PlayerInfo[playerid][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]
SendClientMessageToAll(0x33FF33AA, string);//It will send the message above


Re: i need help - Mean - 04.07.2011

pawn Код:
new
    string[ 128 ],
    playername[ 24 ]
;
GetPlayerName( playerid, playername, 24 );
format( string, sizeof string, "%s has signed as Admin", playername ); // formats the string
if( PlayerInfo[ playerid ][ Level ] > 0 )
    SendClientMessageToAll( 0x33FF33AA, string );//It will send the message above



Re: i need help - ssKiller - 04.07.2011

Thank You!!


Re: i need help - ssKiller - 04.07.2011

Rep. For You.