SA-MP Forums Archive
Help with Zcmd - 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: Help with Zcmd (/showthread.php?tid=235379)



Help with Zcmd - Markx - 05.03.2011

Hey all again xD

So i got this:

pawn Код:
COMMAND:terroristlevel2(playerid, params[])
{
    #pragma unused params
    if (IsPlayerTerroristLevel1[playerid] == 1)
    {
    if(GetPlayerMoney(playerid) < 100000) return SendClientMessage(playerid, COLOR_RED, "ERROR : You need to have 100 000$ to be Level 2!");
    IsPlayerTerroristLevel2[playerid] = true;
    GivePlayerMoney(playerid, -100000);
    GivePlayerWeapon(playerid, 36, 999999);
    GivePlayerWeapon(playerid, 24, 999999);
    GivePlayerWeapon(playerid, 16, 999999);
    GivePlayerWeapon(playerid, 27, 999999);
    GivePlayerWeapon(playerid, 31, 999999);
    SendClientMessage(playerid, COLOR_BLUE, "SUCESS : You are now Level 2! Check out Your new Weapons! You can now drive Rhinos, Hydras, Hunters!");
    }
    else if (IsPlayerTerroristLevel1[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_RED, "ERROR : You aren't a Terrorist!");
    }
    else if (IsPlayerTerroristLevel2[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_RED, "ERROR : You are alredy Level 2!");
    }
    return true;
}
The Problem is: a player can spam with /terroristlevel2 (if he got money)


Re: Help with Zcmd - Markx - 05.03.2011

Help someone!


Re: Help with Zcmd - rjjj - 05.03.2011

I did it

pawn Код:
COMMAND:terroristlevel2(playerid, params[])
{
    #pragma unused params
    if (IsPlayerTerroristLevel1[playerid] == 1)
    {
        if(GetPlayerMoney(playerid) < 100000) return SendClientMessage(playerid, COLOR_RED, "ERROR : You need to have 100 000$ to be Level 2!");
        IsPlayerTerroristLevel1[playerid] = false;//Set the level 1 terrorist variable do 0
        IsPlayerTerroristLevel2[playerid] = true;//And after, put him as a level 2 player
        GivePlayerMoney(playerid, -100000);
        GivePlayerWeapon(playerid, 36, 999999);
        GivePlayerWeapon(playerid, 24, 999999);
        GivePlayerWeapon(playerid, 16, 999999);
        GivePlayerWeapon(playerid, 27, 999999);
        GivePlayerWeapon(playerid, 31, 999999);
        SendClientMessage(playerid, COLOR_BLUE, "SUCESS : You are now Level 2! Check out Your new Weapons! You can now drive Rhinos, Hydras, Hunters!");
    }
    else if (IsPlayerTerroristLevel1[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_RED, "ERROR : You aren't a Terrorist!");
    }
    else if (IsPlayerTerroristLevel2[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_RED, "ERROR : You are alredy Level 2!");
    }
    return true;
}
I hope that i have helped


Re: Help with Zcmd - Markx - 05.03.2011

Thanks you got credits :P