I also need it for DestroyVehicle(Array[playername]); since the vehicle blows up, i need it for many more uses, i just need to have 1 array and 2 functions, meanings or smth attached to it.
P.S. It's not going to be only Paranoja the name.. It will be many random names. There's abit of my code:
Код:
new query1[256];
new usercar[11][128];
new usercaruniqueid;
new usercarowner;
new usercarmodelid;
new Float:usercarspawnX;
new Float:usercarspawnY;
new Float:usercarspawnZ;
new Float:usercarangle;
new usercarcolor1, usercarcolor2;
new usercartune;
new usercarlocked;
new usercarid[MAX_PLAYER_NAME];
format(query1, sizeof(query1), "SELECT id,owner,modelid,spawn_x,spawn_y,spawn_z,angle,color1,color2,tune,locked FROM `ucars`");
samp_mysql_query(query1);
samp_mysql_store_result();
while(samp_mysql_fetch_row(query1)) {
split(query1, usercar, '|');
usercaruniqueid = strval(usercar[0]);
usercarowner = strval(usercar[1]);
usercarmodelid = strval(usercar[2]);
usercarspawnX = floatstr(usercar[3]);
usercarspawnY = floatstr(usercar[4]);
usercarspawnZ = floatstr(usercar[5]);
usercarangle = floatstr(usercar[6]);
usercarcolor1 = strval(usercar[7]);
usercarcolor2 = strval(usercar[8]);
usercartune = strval(usercar[9]);
usercarlocked = strval(usercar[10]);
usercarid[usercarowner] = CreateVehicle(usercarmodelid,usercarspawnX,usercarspawnY,usercarspawnZ,usercarangle,usercarcolor1,usercarcolor2,-1);
for (players=0;players<MAX_PLAYERS; players++) {
SetVehicleParamsForPlayer(usercarid[usercarowner],players,0,1);
}
}
Mysql Entry: id: 1, owner: paranoja, modelid: 540, spawn_x: xlocation, spawn_y: ylocation, spawn_z: zlocation, angle: angle, color1: 1, color2: 1
As you can see on the end of the script, the car must lock, but it doesn't.