30.01.2017, 22:29
Well, this is the code:
No matter what car I enter, I get this message once:
And this message twice:
And I still don't know why because I used this:
and
Here is how I load vType:
Код:
for(new i = 0; i < MAX_PVEHICLES; i++) { if(VehicleInfo[i][vType] == 2) { if(newstate == PLAYER_STATE_DRIVER) { SendClientMessage(playerid, -1, "| This is a Spawn Vehicle | Respawn time: 200 seconds |"); } } if(VehicleInfo[i][vType] == 1) { if(newstate == PLAYER_STATE_DRIVER) { if(!strcmp(VehicleInfo[i][vOwner],"Noone", true)) { SendClientMessage(playerid, -1, "| This vehicle is owned by x |"); } else { SendClientMessage(playerid, -1, "| This vehicle is for sale |"); } } } }
Код:
SendClientMessage(playerid, -1, "| This is a Spawn Vehicle | Respawn time: 200 seconds |");
Код:
SendClientMessage(playerid, -1, "| This vehicle is owned by x |");
Код:
if(VehicleInfo[i][vType] == 2)
Код:
if(VehicleInfo[i][vType] == 1)
Here is how I load vType:
Код:
stock LoadVehicleStats() { new DB_Query[1024]; for(new i = 0; i < MAX_PVEHICLES; i++) { mysql_format(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `Vehicles` WHERE `ID` = '%d'", i); mysql_query(Database, DB_Query); cache_get_value_int(0, "ID", VehicleInfo[i][ID]); cache_get_value(0, "Owner", VehicleInfo[i][vOwner]); cache_get_value_int(0, "vModel", VehicleInfo[i][vModel]); cache_get_value_float(0, "Pos_x", VehicleInfo[i][vPos_x]); cache_get_value_float(0, "Pos_y", VehicleInfo[i][vPos_y]); cache_get_value_float(0, "Pos_z", VehicleInfo[i][vPos_z]); cache_get_value_float(0, "Rot", VehicleInfo[i][vRot]); cache_get_value_int(0, "Fuel", VehicleInfo[i][vFuel]); cache_get_value_int(0, "Type", VehicleInfo[i][vType]); cache_get_value(0, "Plate", VehicleInfo[i][vPlate]); cache_get_value_int(0, "vLock", VehicleInfo[i][vLock]); cache_get_value_int(0, "Color1", VehicleInfo[i][vColor1]); cache_get_value_int(0, "Color2", VehicleInfo[i][vColor2]); cache_get_value_int(0, "RespawnDelay", VehicleInfo[i][vRespawnDelay]); cache_get_value_int(0, "Price", VehicleInfo[i][vPrice]); VehicleInfo[i][Vehicle_Cache] = cache_save(); pvehicle[VehicleInfo[i][ID]] = CreateVehicle(VehicleInfo[i][vModel], VehicleInfo[i][vPos_x], VehicleInfo[i][vPos_y], VehicleInfo[i][vPos_z], VehicleInfo[i][vRot], VehicleInfo[i][vColor1], VehicleInfo[i][vColor2], VehicleInfo[i][vRespawnDelay]); } return 1; }