Createvehicle
#1

hee all,

i noticed that samp confuses when you create a vehicle like this:

createveh[playerid] = CreateVehicle(418, RaceCoords[0][0], RaceCoords[0][1], RaceCoords[0][2]+2, RaceCoords[0][3], -1, -1 ,60);

sometimes when one of them respawns, an other car respawns to.

they just mix up, is it a bug in samp, or would it be my code??

thanks in advance
Reply
#2

id check your code
iv never had this happen.
Reply
#3

me 2
Reply
#4

It shouldn't. It also (almost) can't be a samp bug, it would be a PAWN bug, considering you're storing the vehicle ID in an array. Most logical thing is; you're overwriting the variable.

For example;

You think variable createveh[playerid] holds value 1, but you accidentaly, spawned another car under the same playerid, making it 2. Thus car 2 respawns instead of 1. I suggest you debug using print messages printing out the value everytime you use it to see where it mixes up. If that doesn't work, we're going to need more code.
Reply
#5

yes that's the most obvious awnser though i shall share some code:

new str1[255],pname[24];
GetPlayerName(playerid, pname, 24);
format(str1, sizeof(str1), "Playercars/Users/%s", udb_encode(pname));
for(new i; i<MAX_PLAYERCARS; i++)
{
if(IsPlayerInVehicle(playerid, pInfo[i][PlayerCar]))
{
if(dini_Int(str1, "Playercarid") != i)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "This vehicle isn't yours!");

the problem is, sometimes when i enter one of the createveh's i also get this message.. like how is that even possible??
Reply
#6

either i do spawn these cars ingame, might that be it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)