bekomme eine Leere Nachricht
enum carEnum{
id_x,
model,
besitzer,
Float:c_x,
Float:c_y,
Float:c_z,
Float:c_r,
db_id,
pctank,
ckz,
bname[30]
}
createPlayerCar(playerid,modelid,Float:x,Float:y,Float:z,Float:r)
{
for(new i=0; i<sizeof(cInfo); i++)
{
if(cInfo[i][id_x]!=0)continue;
new string[30];
format(string,sizeof(string),"%s",getPlayerName(playerid));
format(cInfo[i][bname],30,string);
cInfo[i][besitzer]=sInfo[playerid][db_id];
cInfo[i][c_x]=x;
cInfo[i][c_y]=y;
cInfo[i][c_z]=z;
cInfo[i][c_r]=r;
cInfo[i][model]=modelid;
cInfo[i][id_x] = CreateVehicle(modelid,x,y,z,r,-1,-1,-1);
tank[cInfo[i][id_x]] = 100;
SetVehicleParamsEx(cInfo[i][id_x],0,0,0,1,0,0,0);
saveCarToDB(playerid,i);
new str[10],plate;
plate = GetFreeNumberPlate();
format(str, sizeof(str), "PRP-SA-%d", plate);
cInfo[i][ckz] = SetVehicleNumberPlate(cInfo[i][id_x],str);
new query[256];
format(query,sizeof(query),"UPDATE autos SET Kennzeichen='%s' WHERE id='%i'",cInfo[i][ckz],cInfo[i][db_id]);
mysql_function_query(dbhandle,query,false,"","");
return 1;
}
return 1;
}
public OnPlayerCarsLoad(playerid)
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(!num_rows)return 1;
for(new i=0; i<num_rows; i++)
{
new id=getFreeCarID();
new string[30];
format(string,sizeof(string),"%s",getPlayerName(playerid));
format(cInfo[i][bname],30,string);
cInfo[id][model]=cache_get_field_content_int(i,"model",dbhandle);
cInfo[id][besitzer]=cache_get_field_content_int(i,"besitzer",dbhandle);
cInfo[id][c_x]=cache_get_field_content_float(i,"x",dbhandle);
cInfo[id][c_y]=cache_get_field_content_float(i,"y",dbhandle);
cInfo[id][c_z]=cache_get_field_content_float(i,"z",dbhandle);
cInfo[id][c_r]=cache_get_field_content_float(i,"r",dbhandle);
cInfo[id][pctank]=cache_get_field_content_int(i,"tank",dbhandle);
cache_get_field_content(i,"Kennzeichen",cInfo[id][ckz],dbhandle,20);
cInfo[id][db_id]=cache_get_field_content_int(i,"id",dbhandle);
cInfo[id][id_x]=CreateVehicle(cInfo[id][model],cInfo[id][c_x],cInfo[id][c_y],cInfo[id][c_z],cInfo[id][c_r],-1,-1,-1);
SetVehicleNumberPlate(cInfo[id][id_x],cInfo[id][ckz]);
tank[cInfo[id][id_x]] = (cInfo[id][pctank]);
}
return 1;
}
stock GetAutoBesitzer(playerid,vehicleid)
{
new string[50];
for(new i=0; i<sizeof(cInfo); i++)
{
if(cInfo[i][id_x] == vehicleid)
{
format(string,sizeof(string),"%s",cInfo[i][bname]);
SendClientMessage(playerid,ROT,string);
}
}