01.08.2010, 14:04
How to make a car buyable!
veh = CreateVehicle(blah blah)
SetVehicleParams(veh, 1);
public OnPlayerCommandText(playerid, cmdtext[])
if(strcmp("/yourcommand", cmdtext) == 0)
{
GivePlayerMoney(playerid, -yourprice (with minus);
DestroyVehicle(veh);
new Float:x, Float:y, Float:z
GetPlayerPos(playerid, x, y, z);
CreateVehicle(blah, x+5, y+5, z);
}
pawn Код:
Something basic like that |
[pawn]
// at top veh = CreateVehicle(blah blah) SetVehicleParams(veh, 1); //OnPlayerCommandText duh public OnPlayerCommandText(playerid, cmdtext[]) if(strcmp("/yourcommand", cmdtext) == 0) { GivePlayerMoney(playerid, -yourprice (with minus); DestroyVehicle(veh); new Float, Float:y, Float:z GetPlayerPos(playerid, x, y, z); CreateVehicle(blah, x+5, y+5, z); } |