18.05.2009, 22:36
Hello
The script here is ment to remove the player if not the owner
that works ok but if you do owner the car it still removes the owner
Help me!!
The script here is ment to remove the player if not the owner
that works ok but if you do owner the car it still removes the owner
Help me!!
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate==2) { for(new i = 0; i < sizeof(CarInfo); i++) { new newcar = GetPlayerVehicleID(playerid); new string[500]; new Owner = CarInfo[i][cOwner]; if(newcar == CarInfo[i][ownedvehicle]) { if(CarInfo[i][cOwned]==0) { TogglePlayerControllable(playerid, 0); CarOffered[playerid]=1; format(string,sizeof(string),"~w~Car: %s~n~Price: ~g~%d~n~~w~/carbuy to buy this car",CarInfo[i][cDescription],CarInfo[i][cValue]); GameTextForPlayer(playerid,string,5000,5); return 1; } else if(Owner == playerid) { SendClientMessage(playerid,Green,"Welcome back to your car"); return 1; } else if(Owner !=playerid) { format(string,sizeof(string),"~b~this car is Owned by ~n~~w~ %s",CarInfo[i][cOwner]); GameTextForPlayer(playerid,string,5000,5); RemovePlayerFromVehicle(playerid); return 1; } } } }return 0; }