SA-MP Forums Archive
Class command - 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: Class command (/showthread.php?tid=430144)



Class command - NathNathii - 12.04.2013

I did create a /swatweaps so people in the S.W.A.T class do get weapons.
But when I tried the command in another class they get the weapons to?

pawn Код:
CMD:swatweaps(playerid, params[])
{
    if(GetPlayerTeam(playerid) == TEAM_SWAT)
    GivePlayerWeapon(playerid, 3, 1);
    GivePlayerWeapon(playerid, 22, 1000);
    GivePlayerWeapon(playerid, 31, 2500);
    GivePlayerWeapon(playerid, 29, 1500);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "You do now have S.W.A.T Weapons");
    return 1;
}



Re: Class command - Humprabbit - 12.04.2013

Anybody correct me if i am wrong but i swear it is meant to be like:
Код:
CMD:swatweaps(playerid, params[])
{
    if(GetPlayerTeam(playerid) == TEAM_SWAT)
    {
         GivePlayerWeapon(playerid, 3, 1);
         GivePlayerWeapon(playerid, 22, 1000);
         GivePlayerWeapon(playerid, 31, 2500);
         GivePlayerWeapon(playerid, 29, 1500);
         SendClientMessage(playerid, COLOR_LIGHTBLUE, "You do now have S.W.A.T Weapons");
    }
    return 1;
}
try it.


Re: Class command - Djole1337 - 12.04.2013

pawn Код:
if(GetPlayerTeam(playerid) != TEAM_SWAT)
    return SendClientMessage(playerid, -1, "You're not swat");



Re: Class command - NathNathii - 12.04.2013

Thanks both of you.


Re: Class command - Humprabbit - 12.04.2013

No problem, I'm bored -_-