/nitro command
#1

can someone please make me /nitro command please
I really need it, thank you.
Reply
#2

Use this https://sampwiki.blast.hk/wiki/AddVehicleComponent
Reply
#3

Here, i did it for you :P

pawn Код:
dcmd_nitro(playerid, params[])
{
    #pragma unused params
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You're not in any vehicle");
    {
        if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000FF, "You must be the driver to use this command.");
        {
            new vehicleid;
            vehicleid = GetPlayerVehicleID(playerid);
           
            AddVehicleComponent(vehicle, 1010);
            return 1;
        }
    }
}
It should work =/ Havent tested it
Reply
#4

Unknown The command does not work.
Reply
#5

Quote:
Originally Posted by ParaMedicalzZ
Посмотреть сообщение
Unknown The command does not work.
Are you using "strcmp" or "dcmd" or whatever?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/nitro", true) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You're not in any vehicle");
        {
            if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000FF, "You must be the driver to use this command.");
            {
                new vehicleid;
                vehicleid = GetPlayerVehicleID(playerid);

                AddVehicleComponent(vehicleid, 1010);
                SendClientMessage(playerid, 0xFF0000FF, "Nitro x10 Added");
                return 1;
            }
        }
    }
    return 1;
}
Reply
#6

Perfect thank you.
Reply
#7

i use zcmd

Quote:

CMD:nitro(playerid, params[])
{
#pragma unused params
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "You're not in any vehicle");
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000FF, "You must be the driver to use this command.");
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);

AddVehicleComponent(vehicle, 1010);
return 1;
}
}
}

than pawno say this
Quote:

C:\Documents and Settings\User\Desktop\Server SA-MP OPEN BETA(ary)\gamemodes\tombodos.pwn(719) : error 017: undefined symbol "vehicle"
C:\Documents and Settings\User\Desktop\Server SA-MP OPEN BETA(ary)\gamemodes\tombodos.pwn(717) : warning 204: symbol is assigned a value that is never used: "vehicleid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

please help i want it works with ZCMD
Reply
#8

Make your own topic?
Also fix your indentation, makes it alot easyer to fix errors.
Reply
#9

PHP код:
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!
strcmp(cmdtext,"/nitro",true))
    {
       new 
vehicleid GetPlayerVehicleID(playerid);
       
AddVehicleComponent(vehicleid1010);
       
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
       return 
1;
    }
    return 
0;

Try this one
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)