SA-MP Forums Archive
Nitro Script! - 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: Nitro Script! (/showthread.php?tid=206228)



Nitro Script! - Marios - 03.01.2011

Can somebody give me a script for nitro? I want a command /nitro, when someone type this get nitro in the can that is in and pay 1000$. thanks!!! is there any script?


Re: Nitro Script! - Larsey123IsMe - 03.01.2011

Try this.. Not tested:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new vehicleid;
    vehicleid = GetPlayerVehicleID(playerid);
   
    if (strcmp("/nitro", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF0000FF,"You must be in a vehicle.");
        {
            if(GetPlayerMoney(playerid) <1000) return SendClientMessage(playerid,0xFF0000FF,"You need $1000 to buy nos.");
            {
                GivePlayerMoney(playerid, -1000); // -1000
                AddVehicleComponent(vehicleid, 1010); // 10x Nitro
                return 1;
            }
        }
    }
    return 0;
}



Re: Nitro Script! - Marios - 03.01.2011

Amazing! it works