SA-MP Forums Archive
I Need Help - 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 Need Help (/showthread.php?tid=315168)



I Need Help - Maftaca - 02.02.2012

Pls.. help me!! i got a problem.. I got a Gang-war server, i putted a Message when join

Quote:

if(classofballas[playerid] == 1)
{
format(string, sizeof(string), "%s has been spawned!", playername);
SendToBallas(COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW, "You joined the Ballas");
}

else if(classofgrove[playerid] == 1)

{
format(string, sizeof(string), "%s has been spawned!", playername);
SendToGrove(COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW, "You joined the Grove Street.");
}

else if(classofvagos[playerid] == 1)

{
format(string, sizeof(string), "%s has been spawned!", playername);
SendToVagos(COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW, "You joined the Vagos.");
}

else if(classofaztecaz[playerid] == 1)

{
format(string, sizeof(string), "%s has been spawned!", playername);
SendToAZTECAZ(COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW, "You joined the Aztecas.");
}

else if(classoftriads[playerid] == 1)

{
format(string, sizeof(string), "%s has been spawned!", playername);
SendToTriads(COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW, "You joined the Triads.");
}

else if(classoflspd[playerid] == 1)

{
format(string, sizeof(string), "%s has been spawned!", playername);
SendToLSPD(COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW, "You joined the Police.");
}

else if(classofstaff[playerid] == 1)

{
format(string, sizeof(string), "%s has been spawned!", playername);
SendToStaff(COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW, "Welcome, Admin!");
}
return 1;
}

Pls help me.. Here is a Picture of the problem!!


The skin that i choosed:



And here is after i choosed:



LOOK AT THE CHAT

What i do? [I'm not good scripter, i was]

PLEASE HELP ME


Re: I Need Help - Rokzlive - 02.02.2012

First: You dont lose your scripting skill, i stopped for a year and only had a few little roadblocks when starting back up.

Second: DONT USE CAPS! WE GET IT!

Third: You need to check what class they spawn into. Then, when that is checked, make the proper variable = 1, and all others = 0.

(I dont know a better way to explain.)


Re: I Need Help - 2KY - 02.02.2012

Set their class via OnPlayerRequestClass:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 1:
        {
            //If their Class ID is 1, then they're in Grove.
            classofgrove[playerid] = 1;
        }
        case 2:
        {
            //If their Class ID is 2, then they're in the Ballas.
            classofballas[playerid] = 1;
        }
        //Continue this..
    }
    return 1;
}