Vehicle attach problem - 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)
+--- Thread: Vehicle attach problem (
/showthread.php?tid=295182)
Vehicle attach problem -
Alvin007 - 05.11.2011
Hello i'm Alvin007 the devlopper of Chicago Roleplay , i've completed 80% of it , but there is a problem
OnPlayerCommandText
i'm making a command for cops only , to attach undercover lights to their vehicle. so i'm using
model = GetVehicleModel(vehicleid)
and when i compile it says undefined symbol "vehicleid"
so i changed it with: GetVehicleID(playerid) and it works perfectly.
but i want to know why it doesnt work for GetVehicleModel(vehicleid);
Thank you.
Re: Vehicle attach problem -
Sascha - 05.11.2011
because there is not default variable called "vehicleid" at the "OnPlayerCommandText" callback...
The server/the script simply doesn't know what "vehicleid" should be, so you need to define it.
you can e.g. use this about your "GetVehicleModel" line:
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
Re : Re: Vehicle attach problem -
Alvin007 - 05.11.2011
Quote:
Originally Posted by Sascha
because there is not default variable called "vehicleid" at the "OnPlayerCommandText" callback...
The server/the script simply doesn't know what "vehicleid" should be, so you need to define it.
you can e.g. use this about your "GetVehicleModel" line:
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
|
yeah i have made this and it works perfectly , but it's not possible that they attach the undercover lights to every vehicle they enter ? using GetVehicleModel(vehicleid) ?
Re: Vehicle attach problem -
sleepysnowflake - 05.11.2011
It is. Put hte undercover light attach code under
pawn Код:
public OnPlayerEnterVehicle(playerid,vehicleid)