case 5:
{
if(GetPlayerMoney(playerid) < 40000)
return SendClientMessage(playerid,COLOR_RED,"--> You don't have $40000!") && SetPlayerPos(playerid,-1979.8074,270.1521,35.1719) && TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-40000);
SetPlayerPos(playerid,-1979.8074,270.1521,35.1719);
GetPlayerPos(playerid,x,y,z);
PlayerPlaySound(playerid,1058,0,0,0);
TogglePlayerControllable(playerid,1);
CreateVehicle(402,x+2,y+2,z+2,0,0,0,0);
return SendClientMessage(playerid, COLOR_YELLOW, "--> You bought a Buffalo!");
}
if(GetPlayerMoney(playerid) < 40000) return SendClientMessage(playerid,COLOR_RED,"--> You don't have $40000!") && SetPlayerPos(playerid,-1979.8074,270.1521,35.1719) && TogglePlayerControllable(playerid,1);
new car;
GivePlayerMoney(playerid,-40000);
car=CreateVehicle(402,-1979.8074,270.1521,35.1719,0,0,0,0);
PutPlayerInVehicle(playerid, car, 0);
PlayerPlaySound(playerid,1058,0,0,0);
TogglePlayerControllable(playerid,1);
return SendClientMessage(playerid, COLOR_YELLOW, "--> You bought a Buffalo!");
Originally Posted by DJDhan
there should be an else after an if maybe that's why it's not spawning in the new coordinates
|
Originally Posted by Jeffry
Try to use it UNDER PogglePlayerControllable.
Maybe it helps. |
x=-1979.8074,y=270.1521,z=35.1719; SetPlayerPos(playerid, x,y,z); PlayerPlaySound(playerid,1058,0,0,0); TogglePlayerControllable(playerid,1); CreateVehicle(402,x+2,y+2,z+2,0,0,0,0); return SendClientMessage(playerid, COLOR_YELLOW, "--> You bought a Buffalo!");
Originally Posted by FUNExtreme
Quote:
|
case 5:
{
if(GetPlayerMoney(playerid) < 40000)
return SendClientMessage(playerid,COLOR_RED,"--> You don't have $40000!") && SetPlayerPos(playerid,-1979.8074,270.1521,35.1719) && TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-40000);
SetPlayerPos(playerid,-1979.8074,270.1521,35.1719);
new Float:x,Float:y,Float:z; //That line. Else x,y,z are seen as values of zero (0)
GetPlayerPos(playerid,x,y,z);
PlayerPlaySound(playerid,1058,0,0,0);
TogglePlayerControllable(playerid,1);
CreateVehicle(402,x+2,y+2,z+2,0,0,0,0);
return SendClientMessage(playerid, COLOR_YELLOW, "--> You bought a Buffalo!");
}