i cant make join/leave messages -
OxGeRo - 16.07.2010
ok i was making join messages and leave messages using samp wiki tutorial, compiled and got:
C:\Users\MYUSERNAME\Desktop\Favorites\[NR] Call of Duty Nuke's Return\filterscripts\joinmsg.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnPlayerConnect")
C:\Users\MYUSERNAME\Desktop\Favorites\[NR] Call of Duty Nuke's Return\filterscripts\joinmsg.pwn(3) : error 017: undefined symbol "MAX_PLAYER_NAME"
C:\Users\MYUSERNAME\Desktop\Favorites\[NR] Call of Duty Nuke's Return\filterscripts\joinmsg.pwn(3) : error 029: invalid expression, assumed zero
C:\Users\MYUSERNAME\Desktop\Favorites\[NR] Call of Duty Nuke's Return\filterscripts\joinmsg.pwn(3) : error 017: undefined symbol "string"
C:\Users\MYUSERNAME\Desktop\Favorites\[NR] Call of Duty Nuke's Return\filterscripts\joinmsg.pwn(3) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
code:
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "[JOIN](%s)%d", playerid,pname);
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason)
{
case 0: format(string, sizeof(string), "[TIMEOUT](%s)%d", playerid,pname);
case 1: format(string, sizeof(string), "[LEFT](%s)%d", playerid,pname);
case 2: format(string, sizeof(string), "[KICKED/BANNED](%s)%d", playerid,pname);
}
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
what i was trying to do is:
a player joins this comes up: [JOIN](id)PLAYERSUSERNAME
when a player leaves: [LEFT](id)PLAYERUSERNAME
when a player timeouts: [TIMEOUT](id)PLAYERUSERNAME
when a player is kicked/banned: [KICKED/BANNED](id)PLAYERUSERNAME
another thing i wanted to add but didnt know how is that the players ip is displayed when they connect and
display it for admins only!
and example using join(i do want this for all messages): [JOIN](id)PLAYERUSERNAME [IP:THEIRIP]
Re: i cant make join/leave messages -
DeathOnaStick - 16.07.2010
I guess you forgot this:
Over the script with it and it will be fixed i guess, although i didnt read the code completely.
Re: i cant make join/leave messages -
OxGeRo - 16.07.2010
ok ill try it now
Re: i cant make join/leave messages -
OxGeRo - 16.07.2010
that lowerd to 1 error but i still get this in compiler
C:\Users\MYUSERNAME\Desktop\Favorites\[NR] Call of Duty Nuke's Return\filterscripts\joinmsg.pwn(22) : error 030: compound statement not closed at the end of file (started at line 12)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
how to end compound statement?? im sorta new at scripting
Re: i cant make join/leave messages -
Kar - 16.07.2010
put this "}" at the end
Re: i cant make join/leave messages -
OxGeRo - 16.07.2010
Quote:
Originally Posted by kar
put this "}" at the end
|
i love you thanks (not gay way) but if u can please help me with the ip thing read first post to understand
Re: i cant make join/leave messages -
Kar - 16.07.2010
i dont really have that sorry >.< you can use the geo ip plugin though
Re: i cant make join/leave messages -
OxGeRo - 16.07.2010
PROBLEM i tried it out and it said this [JOIN]()79
i also kicked so i wouldnt quit and i could view leave messages and i got same thing but [KICKED/BANNED]
it didnt get the id in fact it was just two brackets and didnt get username please fix if u can code at top
Re: i cant make join/leave messages -
[HUN]Jaki - 16.07.2010
Replace playerid and pname (everywhere)!
(e.g.
pawn Код:
format(string, sizeof(string), "[TIMEOUT](%s)%d", playerid,pname);
with
pawn Код:
format(string, sizeof(string), "[TIMEOUT](%s)%d", pname, playerid);
)
Re: i cant make join/leave messages -
OxGeRo - 19.07.2010
i did and i got this with compile
C:\Users\MYUSERNAME\Desktop\Favorites\[NR] Call of Duty Nuke's Return\filterscripts\joinmsg.pwn(
: error 035: argument type mismatch (argument 1)
C:\Users\MYUSERNAME\Desktop\Favorites\[NR] Call of Duty Nuke's Return\filterscripts\joinmsg.pwn(
: error 035: argument type mismatch (argument 2)
C:\Users\MYUSERNAME\Desktop\Favorites\[NR] Call of Duty Nuke's Return\filterscripts\joinmsg.pwn(17) : error 035: argument type mismatch (argument 1)
C:\Users\MYUSERNAME\Desktop\Favorites\[NR] Call of Duty Nuke's Return\filterscripts\joinmsg.pwn(17) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.