Connection Messages
#1

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

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.

Reply
#3

Forgot the first 'e' in 'playername'.
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)