SA-MP Forums Archive
WHat is wrong? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: WHat is wrong? (/showthread.php?tid=185697)



WHat is wrong? - Mystique - 25.10.2010

What the hell is wrong with this?

pawn Код:
if(classid == 19 || 193 || 1 ||  22 || 40)
    {
    GameTextForPlayer(playerid, "~r~Team Red", 3000, 3);
    }
    else if(classid == 72 || 143 || 176 ||  259 || 275)
    {
    GameTextForPlayer(playerid, "~b~Team Blue", 3000, 3);
    }
I have it under OnPlayerRequestclass but when it comes to 72 and those skins it just shows Team Red...


Re: WHat is wrong? - Scripter123 - 25.10.2010

Hmm why you dont do:

pawn Код:
if(classid == 19)
    {
    GameTextForPlayer(playerid, "~r~Team Red", 3000, 3);
    }
    else if(classid == 72)
    {
    GameTextForPlayer(playerid, "~b~Team Blue", 3000, 3);
    }

So one else if per classid, try that i have that in my GM and it works


Re: WHat is wrong? - Cameltoe - 25.10.2010

Hmm:

pawn Код:
if(classid == 19 || classid == 193 || classid == 1 || classid ==  22 || classid == 40)
    {
    GameTextForPlayer(playerid, "~r~Team Red", 3000, 3);
    }
    else if(classid == 72 || classid == 143 || classid == 176 || classid ==  259 || classid == 275)
    {
    GameTextForPlayer(playerid, "~b~Team Blue", 3000, 3);
    }
EDIT:


Quote:
Originally Posted by Zezombia
Посмотреть сообщение
Each "||" is a different instance. For example:

pawn Код:
if(cookie == 1 || cookie == 2)
means:

pawn Код:
if(cookie == 1)
//OR
if(cookie == 2)
So what you have is:

pawn Код:
if(classid == 19)
//OR
if(193)
That doesn't make much sense. You have to include a "classid ==" in every instance:

pawn Код:
if(classid == 19 || classid ==  193 || classid == 1 || classid == 22 || classid == 40)



Re: WHat is wrong? - Zezombia - 25.10.2010

Each "||" is a different instance. For example:

pawn Код:
if(cookie == 1 || cookie == 2)
means:

pawn Код:
if(cookie == 1)
//OR
if(cookie == 2)
So what you have is:

pawn Код:
if(classid == 19)
//OR
if(193)
That doesn't make much sense. You have to include a "classid ==" in every instance:

pawn Код:
if(classid == 19 || classid ==  193 || classid == 1 || classid == 22 || classid == 40)



Re: WHat is wrong? - Scripter123 - 25.10.2010

I think my its good, but the cameltoe post are good too... If the cameltoe pawn code work use it


Re: WHat is wrong? - Zezombia - 25.10.2010

It doesn't help to just use code made by other people, Scripter123. If he wants to make his own work, he has to know what he's doing wrong. How else is he going to get better, and what's he going to do next time he comes across a similar problem?


Re: WHat is wrong? - Mystique - 25.10.2010

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Hmm:

pawn Код:
if(classid == 19 || classid == 193 || classid == 1 || classid ==  22 || classid == 40)
    {
    GameTextForPlayer(playerid, "~r~Team Red", 3000, 3);
    }
    else if(classid == 72 || classid == 143 || classid == 176 || classid ==  259 || classid == 275)
    {
    GameTextForPlayer(playerid, "~b~Team Blue", 3000, 3);
    }
EDIT:
Now the problem is that it only shows for skin ID 193...


Re: WHat is wrong? - Zezombia - 25.10.2010

It shouldn't, unless your confusing "skinid" with "classid".

Skinid puts an ID on a skin relative to when you added the class to the script. Example:

pawn Код:
AddPlayerClass(19, etc); //CLASSID 0
AddPlayerClass(193, etc); //CLASSID 1
AddPlayerClass(1, etc); //CLASSID 2



Re: WHat is wrong? - Mystique - 25.10.2010

pawn Код:
AddPlayerClass(19, 837.604003, -2055.016845, 12.867187, 357.875885, 31, 500, 4, 10000, 23, 50);
    AddPlayerClass(193, 837.604003, -2055.016845, 12.867187, 357.875885, 31, 500, 4, 10000, 23, 50);
    AddPlayerClass(1, 837.604003, -2055.016845, 12.867187, 357.875885, 31, 500, 4, 10000, 23, 50);
    AddPlayerClass(22, 837.604003, -2055.016845, 12.867187, 357.875885, 31, 500, 4, 10000, 23, 50);
    AddPlayerClass(40, 837.604003, -2055.016845, 12.867187, 357.875885, 31, 500, 4, 10000, 23, 50);
    AddPlayerClass(72, 834.047485, -1837.272094, 12.475296, 176.403305, 30, 500, 4, 10000, 23, 50);
    AddPlayerClass(143, 834.047485, -1837.272094, 12.475296, 176.403305, 30, 500, 4, 10000, 23, 50);
    AddPlayerClass(176, 834.047485, -1837.272094, 12.475296, 176.403305, 30, 500, 4, 10000, 23, 50);
    AddPlayerClass(259, 834.047485, -1837.272094, 12.475296, 176.403305, 30, 500, 4, 10000, 23, 50);
    AddPlayerClass(275, 834.047485, -1837.272094, 12.475296, 176.403305, 30, 500, 4, 10000, 23, 50);


pawn Код:
if(classid == 19 || classid == 193 || classid == 1 || classid == 22 || classid == 40)
    {
    GameTextForPlayer(playerid, "~r~Team Red", 3000, 3);
    }
   
    if(classid == 72 || classid == 143 || classid == 176 || classid ==  259 || classid == 275)
    {
    GameTextForPlayer(playerid, "~b~Team Blue", 3000, 3);
    }


Edit: Realized what you meant lmao


Re: WHat is wrong? - Scripter123 - 25.10.2010

Mystique if he know PAWN script, he need to know wath is and how to add CLASS

OMFG if this people search and dont ask.... LOL
But i ask too so....