i need help
#1

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
Reply
#2

Replace 'player1' with 'playerid'

and delete the string variable
Reply
#3

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.
Reply
#4

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.
Reply
#5

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

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
Reply
#7

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
Reply
#8

Thank You!!
Reply
#9

Rep. For You.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)