Little scripting question > Variables. - 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: Little scripting question > Variables. (
/showthread.php?tid=105191)
Little scripting question > Variables. -
JonyAvati - 28.10.2009
Hi, i'm trying to do the following
When the player gets in the car, the vehicle's id is printed into "Vehid" variable:
pawn Код:
//TOP
new Vehid[MAX_VEHICLES];
//
new Vehicleid = GetPlayerVehicleID(playerid);
Vehid[Vehicleid] = Vehicleid(playerid);
And then, I wanna put the guy in that "Vehid", that must be the previous player's vehicle id:
pawn Код:
PutPlayerInVehicle(playerid, Vehid, 0);
And the problem is in Vehid:
Код:
error 035: argument type mismatch (argument 2)
Can someone tell me, WHY! Lol. Maybe making the "Vehid" a global variable. But, IT IS xD.
Re: Little scripting question > Variables. -
Djiango - 28.10.2009
Vehid[Vehicleid] = Vehicleid(playerid);
Shouldn't it be
Vehid[Vehicleid] = Vehicleid;
Re: Little scripting question > Variables. -
JonyAvati - 28.10.2009
Quote:
Originally Posted by |∞|-Рцппσĵσ-|∞|
Vehid[Vehicleid] = Vehicleid(playerid);
Shouldn't it be
Vehid[Vehicleid] = Vehicleid;
|
The same bug :S
Re: Little scripting question > Variables. -
Djiango - 28.10.2009
1. What line is the error on.
2. What callback do you use this in?
pawn Код:
new Vehicleid = GetPlayerVehicleID(playerid);
Vehid[Vehicleid] = Vehicleid(playerid);
3. What's "Vehicleid(playerid)" ?
4. Try this.
pawn Код:
Vehid[vehicleid] = GetPlayerVehicleID(playerid);
Re: Little scripting question > Variables. -
MadeMan - 28.10.2009
What is the point of this?