WHat is wrong?
#1

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

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

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

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

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)