12.06.2009, 11:10
I Have a peice of code so if u buy a car it saves your id so if ur not the car owner and dont have the same id it removes you.
But i dont want it like that i want it to save your NAME and NOT (id)
Here is the code how do i edit it to save your name.
This is the code for when u bought the car
This is the code for when you enter the car and u aint got the same id
But i dont want it like that i want it to save your NAME and NOT (id)
Here is the code how do i edit it to save your name.
This is the code for when u bought the car
Quote:
new boughtcar; new Float,Float:y,Float:z; GetPlayerPos(playerid, x, y, z); GetPlayerName(playerid,buyername,24); boughtcar = CreateVehicle(560, x+3,y,z,91.0247, -1, -1, 99999999999); BoughtCars[boughtcar] =999; BoughtCarsOwner[boughtcar] =playerid; SendClientMessage(playerid, 0xA9A9A9AA, "|_Vehicle Taken_|"); SendClientMessage(playerid, 0x00C7FFAA, "You have taken a Sultan from your AutoBahn"); UsedAutoRecently[playerid] += 90; PutPlayerInVehicle(playerid, boughtcar, 0); printf("**(CAR TAKEN)** %s(%d) has taken a Sultan from his AutoBahn",buyername,playerid); |
Quote:
new string[256]; new name[256]; new playerName[24]; GetPlayerName(playerid, playerName, 24); GetPlayerName(BoughtCarsOwner[GetPlayerVehicleID(playerid)], name, 256); if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && BoughtCars[GetPlayerVehicleID(playerid)] == 999 && playerName[playerid] != name[playerid]) { SendClientMessage(playerid,COLOR_YELLOW,"This car has been purchased from AutoBahn. You are not the owner."); GetPlayerName(BoughtCarsOwner[GetPlayerVehicleID(playerid)], name,sizeof(name)); format(string, sizeof(string), "This vehicle is registered to: %s",name); SendClientMessage(playerid, COLOR_YELLOW, string); RemovePlayerFromVehicle(playerid); |