Buy vehicles - Stick to username
#1

Hi.

Im trying to do so that if you buy a vehicle at a shop, it will stick to your username, but i'm having a bit of troubles saving / checking the usernames.
Here's what i got so far, i hope someone can help me:

Buy vehicle:
new buyername[24];
GetPlayerName(playerid,buyername, 24);
boughtcar = CreateVehicle(560, 2174.2114,1421.0642,10.5913,91.0247, -1, -1, 99999999999);
BoughtCarsOwnerName[boughtcar] = buyername[0];


Here's the script where i check if username is the same as current:
Check script:
new name[256];
GetPlayerName(playerid, name, 255);

if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER && BoughtCars[GetPlayerVehicleID(playerid)] == 999 && BoughtCarsOwnerName[GetPlayerVehicleID(playerid)] != name[0]) {
SendClientMessage(playerid,COLOR_YELLOW,"This car has been purchased from AutoBahn. You are not the owner");
format(string, sizeof(string), "This vehicle is registered to player: %s",BoughtCarsOwnerName[GetPlayerVehicleID(playerid)]);
SendClientMessage(playerid, COLOR_YELLOW, string);
RemovePlayerFromVehicle(playerid);


The scripts up there will return the 1 character from the string, but how the **** should i get the usernames stored in a string instead of a array?
Reply


Messages In This Thread
Buy vehicles - Stick to username - by Webghost - 11.07.2010, 13:43
Re: Buy vehicles - Stick to username - by DeathOnaStick - 11.07.2010, 13:52
Re: Buy vehicles - Stick to username - by Webghost - 11.07.2010, 14:04
Re: Buy vehicles - Stick to username - by Webghost - 11.07.2010, 14:29
Re: Buy vehicles - Stick to username - by Geso - 11.07.2010, 14:38
Re: Buy vehicles - Stick to username - by Geso - 11.07.2010, 14:55
Re: Buy vehicles - Stick to username - by MadeMan - 11.07.2010, 15:04
Re: Buy vehicles - Stick to username - by Webghost - 11.07.2010, 15:24
Re: Buy vehicles - Stick to username - by Geso - 12.07.2010, 08:00

Forum Jump:


Users browsing this thread: 1 Guest(s)