Help with mSelection vehicles - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with mSelection vehicles (
/showthread.php?tid=559326)
Help with mSelection vehicles -
Mark_Samp - 22.01.2015
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.
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;
}
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:
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;
}
but with mSelection instead? Any help?
Re: Help with mSelection vehicles -
Mark_Samp - 22.01.2015
Bump---
Re: Help with mSelection vehicles -
Riso135 - 22.01.2015
In that script you only have bravura and landstalker to buy?
Re: Help with mSelection vehicles -
Mark_Samp - 22.01.2015
Nevermind, Fixed it myself!