Vehicle attach problem
#1

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.
Reply
#2

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);
Reply
#3

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) ?
Reply
#4

It is. Put hte undercover light attach code under
pawn Код:
public OnPlayerEnterVehicle(playerid,vehicleid)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)