SA-MP Forums Archive
I got one error when making my filterscript - 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: I got one error when making my filterscript (/showthread.php?tid=389027)



I got one error when making my filterscript - Private200 - 31.10.2012

I got this error when making the filterscript .

PHP код:
C:\Documents and Settings\Privat\Desktop\Ban.pwn(29) : error 029invalid expressionassumed zero 
and here line is :

pawn Код:
if(GetPlayerName(playerid) == lol))



Re: I got one error when making my filterscript - Azazelo - 31.10.2012

GetPlayerName(playerid) // return string you cannot compare string like this
u must use
Quote:

strcmp(GetPlayerName(playerid), lol, true)




AW: I got one error when making my filterscript - Skimmer - 31.10.2012

Azazelo what are you doing ?

pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));

if(!strcmp(pName, "lol", true))
{
       // your code
}



Re: I got one error when making my filterscript - Private200 - 31.10.2012

idk what azzelo gave me , but it didn't help me for anything ..


AW: I got one error when making my filterscript - Skimmer - 31.10.2012

Use my code.

pawn Код:
new pName[MAX_PLAYER_NAME]; // Creating a new variable to saving players name.
GetPlayerName(playerid, pName, sizeof(pName)); // GetPlayerName saves the players name of the player 'playerid' in this pName variable

if(!strcmp(pName, "lol", true)) // checking is the name of players lol or not.  true means ingorecase so, lOl isn't same as lol when you set it to false LOl is the same as lol
{
       // name is right. Do anything here
}



Re: I got one error when making my filterscript - Private200 - 31.10.2012

Fixed . Thanks