22.01.2015, 15:33
So i have made this system where they /buycar and a Textdraw pops up with all the available cars, but when they press the car they want nothing happens.
I am trying to make so if they press Car #1 they get fined 30k and for car #2 they get fined 3k. I am tryint to make a system like this one:
but with mSelection instead? Any help?
PHP Code:
public OnPlayerModelSelection(playerid, response, listid, modelid)
{
if(listid == carlist)
{
if(response)
{
switch(modelid) {
case 0: {
new string[128];
new playervehicleid = GetPlayerFreeVehicleId(playerid);
//new Float:X,Float:Y,Float:Z;
//GetPlayerPos(playerid,X,Y,Z);
new Float:Angle;
GetPlayerFacingAngle(playerid,Angle);
if(GetPlayerCash(playerid) < 30000) return SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that.");
GivePlayerCash(playerid, -30000);
CreatePlayerVehicle(playerid, playervehicleid, modelid, 1729.6409, 1896.2699, 10.8203, 178.8733, 0, 0, 0);
format(string, sizeof(string), " You have bought a Landstalker");
SendClientMessage(playerid, COLOR_GRAD1, string);
VehicleSpawned[playerid] = 1;
}
case 1: {
new string[128];
new playervehicleid = GetPlayerFreeVehicleId(playerid);
//new Float:X,Float:Y,Float:Z;
//GetPlayerPos(playerid,X,Y,Z);
new Float:Angle;
GetPlayerFacingAngle(playerid,Angle);
if(GetPlayerCash(playerid) < 3000) return SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that.");
GivePlayerCash(playerid, -3000);
CreatePlayerVehicle(playerid, playervehicleid, modelid, 1729.6409, 1896.2699, 10.8203, 178.8733, 0, 0, 0);
format(string, sizeof(string), " You have bought a Bravura");
SendClientMessage(playerid, COLOR_GRAD1, string);
VehicleSpawned[playerid] = 1;
}
}
}
else SendClientMessage(playerid, 0xFF0000FF, "Canceled Car Purchase");
return 1;
}
return 1;
}
Code:
else if(dialogid == DIALOG_SAN_CLOTHES) { switch(listitem) { case 0: { PlayerInfo[playerid][pSkin] = 113; SetPlayerSkin(playerid, 113); } case 1: { PlayerInfo[playerid][pSkin] = 148; SetPlayerSkin(playerid, 148); } } return 1; }