Big noob alert - 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: Big noob alert (
/showthread.php?tid=205675)
Big noob alert -
_rAped - 02.01.2011
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;
}
Re: Big noob alert -
cessil - 02.01.2011
check if the player is in a vehicle using IsPlayerInAnyVehicle or GetPlayerState
Re: Big noob alert -
_rAped - 02.01.2011
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 -.-
Re: Big noob alert -
blackwave - 02.01.2011
Or then you forgot to define the name "fixvehicle" ( I dont know if does exists, since I dont use zcmd)
Re: Big noob alert -
_rAped - 02.01.2011
Quote:
Originally Posted by blackwave
Or then you forgot to define the name "fixvehicle" ( I dont know if does exists, since I dont use zcmd)
|
Ofcourse I included zcmd...
Re: Big noob alert -
DarrenReeder - 02.01.2011
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..
Re: Big noob alert -
Anthonyx3' - 02.01.2011
Yeah i usually use CMD:
IDk where your placing the cmd, but put it under the public oncommandtext, thats what i do
Re: Big noob alert -
DRIFT_HUNTER - 02.01.2011
For me only CMD and cmd_example work's idk why...
And dont put zcmd in OnPlayerCommandText
Re: Big noob alert -
_rAped - 02.01.2011
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?
Re: Big noob alert -
[WF]Demon - 02.01.2011
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?