Connection Messages - 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: Connection Messages (
/showthread.php?tid=449316)
Connection Messages -
Jay_Dixon - 08.07.2013
Basically, i need to know what i did wrong here. I'm trying to make it say like "so and so member <name here> has joined the server", if they have a specific tag in their name, but it causes errors
Код:
C:\Users\Jay\Desktop\GangWarsV.0.1.B\gamemodes\GWDMv1.pwn(963) : error 076: syntax error in the expression, or invalid function call
C:\Users\Jay\Desktop\GangWarsV.0.1.B\gamemodes\GWDMv1.pwn(963) : error 029: invalid expression, assumed zero
C:\Users\Jay\Desktop\GangWarsV.0.1.B\gamemodes\GWDMv1.pwn(968) : error 076: syntax error in the expression, or invalid function call
C:\Users\Jay\Desktop\GangWarsV.0.1.B\gamemodes\GWDMv1.pwn(968) : error 029: invalid expression, assumed zero
C:\Users\Jay\Desktop\GangWarsV.0.1.B\gamemodes\GWDMv1.pwn(971) : warning 202: number of arguments does not match definition
C:\Users\Jay\Desktop\GangWarsV.0.1.B\gamemodes\GWDMv1.pwn(3184) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
pawn Код:
if(strfind, playrname, "[o_O]", true))
{
format(string, sizeof(string), "Owl Balistics member %s has joined the server!", playrname);
SendClientMessageToAll(HOODLUMS_COLOR, string);
}
if(strfind, playrname, "[X_X]", true))
{
format(string, sizeof(string), "Double X Factor member %s has joined the server!", playrname);
SendClientMessageToAll(FAMILY_VIOLET);
}
Re: Connection Messages -
Konstantinos - 08.07.2013
Check how strfind works in the SA:MP wiki and SendClientMessageToAll needs a second parameter on the second if statement.
pawn Код:
if(strfind(playrname, "[o_O]", true) != -1)
{
format(string, sizeof(string), "Owl Balistics member %s has joined the server!", playrname);
SendClientMessageToAll(HOODLUMS_COLOR, string);
}
if(strfind(playrname, "[X_X]", true) != -1)
{
format(string, sizeof(string), "Double X Factor member %s has joined the server!", playrname);
SendClientMessageToAll(FAMILY_VIOLET, string);
}
OnPlayerPrivmsg Callback:
Quote:
Warning: This callback was removed in SA-MP 0.3.
|
Re: Connection Messages -
Aerotactics - 08.07.2013
Forgot the first 'e' in 'playername'.
Re: Connection Messages -
Jay_Dixon - 08.07.2013
Quote:
Originally Posted by Aerotactics
Forgot the first 'e' in 'playername'.
|
I didn't, that's how it's written out for all the other log in messages xD
Re: Connection Messages -
Sandiel - 08.07.2013
First off, that's not how you use strfind. (
https://sampwiki.blast.hk/wiki/Strfind)
Secondly, your SendClientMessageToAll is missing the first argument (COLOR) so add the color to that function and it should work fine.