i cant make join/leave messages
#1

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

I guess you forgot this:

pawn Код:
#include <a_samp>
Over the script with it and it will be fixed i guess, although i didnt read the code completely.
Reply
#3

ok ill try it now
Reply
#4

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

put this "}" at the end
Reply
#6

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

i dont really have that sorry >.< you can use the geo ip plugin though
Reply
#8

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

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);
)
Reply
#10

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


Forum Jump:


Users browsing this thread: 5 Guest(s)