Big noob alert
#1

I'm trying out ZCMD, and whatever I type it returns Unknown Command. Prob something I forgot to add?

pawn Код:
COMMAND:fixvehicle(playerid, params[])
{
    #pragma unused params

    new vid = GetPlayerVehicleID(playerid);
    RepairVehicle(vid);
   
    SendClientMessage(playerid, COLOR_WHITE, "NOTE » Your vehicle has been repaired!");
   
    return 1;
}
Reply
#2

check if the player is in a vehicle using IsPlayerInAnyVehicle or GetPlayerState
Reply
#3

Quote:
Originally Posted by cessil
Посмотреть сообщение
check if the player is in a vehicle using IsPlayerInAnyVehicle or GetPlayerState
Yeah, it's just a quick test. But that's not the problem -.-
Reply
#4

pawn Код:
#include <zcmd>
Or then you forgot to define the name "fixvehicle" ( I dont know if does exists, since I dont use zcmd)
Reply
#5

Quote:
Originally Posted by blackwave
Посмотреть сообщение
pawn Код:
#include <zcmd>
Or then you forgot to define the name "fixvehicle" ( I dont know if does exists, since I dont use zcmd)
Ofcourse I included zcmd...
Reply
#6

Where have you put this? Do not put it under any callbacks... put it outside of the callbacks.. Also, try CMD: aswell, i know COMMAND and CMD are valid, but still worth it to try both..
Reply
#7

Yeah i usually use CMD:

IDk where your placing the cmd, but put it under the public oncommandtext, thats what i do
Reply
#8

For me only CMD and cmd_example work's idk why...
And dont put zcmd in OnPlayerCommandText
Reply
#9

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
For me only CMD and cmd_example work's idk why...
And dont put zcmd in OnPlayerCommandText
It's not under OnPlayerCommandText. But there's probably something I forgot to add?
Reply
#10

i just copied this command and put it in a script real quick and it worked, are you sure its not in any callbacks like
BAD EXAMPLE:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
COMMAND:fixvehicle(playerid, params[])
{
    #pragma unused params

    new vid = GetPlayerVehicleID(playerid);
    RepairVehicle(vid);
   
    SendClientMessage(playerid, COLOR_WHITE, "NOTE » Your vehicle has been repaired!");
   
    return 1;
}
    return 0;
}
GOOD EXAMPLE
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}
COMMAND:fixvehicle(playerid, params[])
{
    #pragma unused params

    new vid = GetPlayerVehicleID(playerid);
    RepairVehicle(vid);
   
    SendClientMessage(playerid, COLOR_WHITE, "NOTE » Your vehicle has been repaired!");
   
    return 1;
}
You sure its the good example?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)