Command Help! - 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: Command Help! (
/showthread.php?tid=77483)
Command Help! -
marszim - 11.05.2009
Код:
if(strcmp(cmd, "/hyd", true) == 0)
{
if(IsPlayerConnected(playerid)) // AddVehicleComponent(vehicle, 1009); // Nitro
{
if (PlayerInfo[playerid][pJob] == 7)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
AddVehicleComponent(GetPlayerVehicleID, 1087);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SafeGivePlayerMoney(playerid, -1000);
format(string, sizeof(string), "*Mechanic %s adds Hydraulics to the Vehicle", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You need to be a Mechanic to use this command!");
}
}
return 1;
}
i get 1 error :
C:\Users\Zak\Desktop\larp.pwn(30031) : error 076: syntax error in the expression, or invalid function call
The error is the line with 'AddVehicleComp', and that is something i just randomly made so i knew i was going to get an error, or something like that.
All i need is someone to teach me how to get the vehicle id :d
Re: Command Help! -
Weirdosport - 11.05.2009
Change:
pawn Код:
AddVehicleComponent(GetPlayerVehicleID, 1087);
To:
pawn Код:
AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
Re: Command Help! -
marszim - 11.05.2009
Quote:
Originally Posted by Weirdosport
Change:
pawn Код:
AddVehicleComponent(GetPlayerVehicleID, 1087);
To:
pawn Код:
AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
|
Thanks alot
.