SA-MP Forums Archive
Cant Find the function to use - 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: Cant Find the function to use (/showthread.php?tid=609317)



Cant Find the function to use - undeteker - 11.06.2016

here is what i am trying to do, i have a dynamic car parking system, i trying that if i doing the command /park the car will park, it works but if i want to update the exact position of the exact car it duplicate the car i want that if the vehicle will not found in the exact position it will create a new one and if the car will found in the exact position it will update the position x y z in file i have the command here :
Quote:

if(strcmp(cmdtext, "/park", true) == 0)
{
new modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,0xFF0000FF,"ERROR: You are not driving a vehicle");
GetVehiclePos(GetPlayerVehicleID(playerid),XX,YY,Z Z);
GetVehicleZAngle(GetPlayerVehicleID(playerid),AA);
SetVehiclePos(GetPlayerVehicleID(playerid),XX,YY,Z Z);
getdate(byear,bmonth,bday);
GetVehicleColor(GetPlayerVehicleID(playerid),ppcol 1,ppcol2);
format(strr,sizeof(strr),"You have added this vehicle to the cars.ini (model %d,Color 1 %d,Color 2 %d)",GetVehicleModel(GetPlayerVehicleID(playerid)) ,ppcol1,ppcol2);
SendClientMessage(playerid,0xFF9900AA,strr);
new Fileos=fopen("Cars.ini", io_append);
format(strr,sizeof(strr),"%d,%f,%f,%f,%f,%d,%d,360 0); //%s(%s %d)",modelid,XX,YY,ZZ,AA,ppcol1,ppcol2);
fwrite(pos, strr);
fclose(pos);
return 1;
}

plis help i appreciate it :}