10.03.2014, 15:57
Hello
I am trying to make a Car System, Car Shop is working but if i wan`t to ask if the User is the Owner it doesn`t work
All user cars will load on Server start and will be Saved all 30 min. So if player wants to lock his Car and type /lock the Server needs to check if user is owner, thats why i made a stock with the name isPlayerCar
Here how its looks
So but for some reason if i enter a Vehicle he says iam Owner. the debug says Carid: 16, PlayerCar: 0 and thats wrong
here the enums and news
Now my Question: How can i Ask if User is Owner of the Car
Sorry for my bad English ^^
I am trying to make a Car System, Car Shop is working but if i wan`t to ask if the User is the Owner it doesn`t work
All user cars will load on Server start and will be Saved all 30 min. So if player wants to lock his Car and type /lock the Server needs to check if user is owner, thats why i made a stock with the name isPlayerCar
Here how its looks
Код:
stock isPlayerCar(playerid) { new vehid; vehid = GetPlayerVehicleID(playerid); if(!strcmp(pCar[vehid][Owner],PlayerName(playerid),false)) return 1; return 0; }
here the enums and news
Код:
enum PlayerCarData { ModelID, Owner[MAX_PLAYER_NAME], Float:posx, Float:posy, Float:posz, Float:posa, Color1, Color2, Price, Key } new pCar[MAX_VEHICLES][PlayerCarData];
Sorry for my bad English ^^