Buy vehicles - Stick to username
#5

Код:
			    	if(GetPlayerMoney(playerid) <= 29999)
					{
			   	    	SendClientMessage(playerid, 0xA9A9A9AA, "|_Car Purchase Failed_|");
			   			SendClientMessage(playerid, COLOR_ERROR, "You cannot afford to buy a Buffalo ($30000)");
			   			return 1;
					}
			   		new boughtcar;
			   		new buyername[MAX_PLAYER_NAME];
			   		GetPlayerName(playerid,buyername,sizeof(buyername));
         	   		boughtcar = CreateVehicle(402, -1985.3544,304.6387,34.9471,269.2919, -1, -1, 99999999999);
         	   		BoughtCars[boughtcar] =999;
         	   		strmid(BoughtCarsOwner[boughtcar], buyername, 0, strlen(buyername), MAX_PLAYER_NAME);
			   		SendClientMessage(playerid, 0xA9A9A9AA, "|_Car Purchased_|");
			   		SendClientMessage(playerid, 0x00C7FFAA, "You have bought a Buffalo from Wang Cars for $30000");
			   		GivePlayerMoney(playerid,-30000);
			   		PutPlayerInVehicle(playerid, boughtcar, 0);
			   		printf("**(CAR PURCHASE)** %s(%d) has purchased a Buffalo from Wang Cars ($30000)",buyername,playerid);
Код:
    new carstring[256];
    if(newstate == PLAYER_STATE_DRIVER)
    {
        new vehid = GetPlayerVehicleID(playerid);
        if(BoughtCars[vehid] == 999) 
        {
            new pName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pName, sizeof(pName));
            if(strcmp(BoughtCarsOwner[vehid], pName, false))
            {
                format(carstring, sizeof(carstring), "This vehicle has been bought by and is registered to: %s", BoughtCarsOwner[vehid]);
                SendClientMessage(playerid, COLOR_YELLOW, carstring);
                SendClientMessage(playerid, COLOR_YELLOW, "You can not drive it.");
                RemovePlayerFromVehicle(playerid);
            }
        }
    }
It's me Geso, you might remember me from lsrcr, ive got the same system out of lvrcr, just use the system above. As long as i used it, it's perfect.
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)