All cars have nitrous?
#1

Hello? I was wondering how to make all cars have nitrous? I have over 100 of the "AddStaticVehicle"

and you know how the server says "SERVER: Unknown command." I seen in other servers.. they changed it. How?
Reply
#2

Quote:
Originally Posted by California_
Посмотреть сообщение
and you know how the server says "SERVER: Unknown command." I seen in other servers.. they changed it. How?
Use this. Edit however you need.
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, -1, "Sorry but that command doesn't exsist!");
    return 1;
}
Reply
#3

Under OnGameModeInit

pawn Код:
for(new i=1; i<MAX_VEHICLES; i++)
{
    AddVehicleComponent(i,1010);
}
Reply
#4

If you want to do with command you should type this code
pawn Код:
if (!strcmp(cmdtext, "/nitro", true)) {
    if (!IsPlayerInAnyVehicle(playerid)) return 1;
    new vehicleid = GetPlayerVehicleID(playerid);
    AddVehicleComponent(vehicleid, 1010); // X10 nitro
    return 1;
}
But if you want to add nitro to the all vehicles you should write this in the end of OnGameModeInit
pawn Код:
for (new i = 0; i < MAX_VEHICLES; i++)
    AddVehicleComponent(i, 1010);
If you have a variable contains last vehicle id (for example, lastVehicleId) you can rewrite your loop as
for (new i = 0; i < lastVehicleId; i++)...
Reply
#5

@Mr.Anonymous: what becomes of when the command returns 0?
Reply
#6

Quote:
Originally Posted by arbit
Посмотреть сообщение
@Mr.Anonymous: what becomes of when the command returns 0?
Err.. "SERVER: Unknown command.".
Reply
#7

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
Err.. "SERVER: Unknown command.".
so because the command returns 0, does that means that it doesn't exist?
Reply
#8

For example this command exist but returns 0 still works.
pawn Код:
CMD:nos(playerid, params[])
{
   new vehicleid = GetPlayerVehicleID(playerid);
   AddVehicleComponent(vehicleid, 1010);
   return 0;
}
Reply
#9

@mr.anonymous: more like this,

pawn Код:
new bool:
    myvar = false
;

YCMD:test(playerid, params[], help)
{
    #pragma unused params
    #pragma unused help
   
    if(!myvar)
    {
        myvar = true;
        return 0;
    }
    else
        myvar = false;
        SendClientMessage(playerid, -1, "true");
    return 1;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
        SendClientMessage(playerid, -1, "command doesn't exist");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)