Name And Not ID Car Ownership
#1

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

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);

This is the code for when you enter the car and u aint got the same id

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);

Reply


Messages In This Thread
Name And Not ID Car Ownership - by Kyle - 12.06.2009, 11:10
Re: Name And Not ID Car Ownership - by Kyle - 12.06.2009, 14:58
Re: Name And Not ID Car Ownership - by Balkan-SF - 12.06.2009, 15:09
Re: Name And Not ID Car Ownership - by Luca Dimonte - 12.06.2009, 16:16
Re: Name And Not ID Car Ownership - by Kyle - 12.06.2009, 16:40
Re: Name And Not ID Car Ownership - by Kyle - 12.06.2009, 18:30

Forum Jump:


Users browsing this thread: 1 Guest(s)