SA-MP Forums Archive
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(playeridresponselistidmodelid)
{
    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(playeridCOLOR_WHITE"You don't have the cash for that.");
                    
GivePlayerCash(playerid, -30000);
                    
CreatePlayerVehicle(playeridplayervehicleidmodelid1729.64091896.269910.8203178.8733000);
                      
format(stringsizeof(string), " You have bought a Landstalker");
                      
SendClientMessage(playeridCOLOR_GRAD1string);
                    
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(playeridCOLOR_WHITE"You don't have the cash for that.");
                    
GivePlayerCash(playerid, -3000);
                    
CreatePlayerVehicle(playeridplayervehicleidmodelid1729.64091896.269910.8203178.8733000);
                      
format(stringsizeof(string), " You have bought a Bravura");
                      
SendClientMessage(playeridCOLOR_GRAD1string);
                    
VehicleSpawned[playerid] = 1;
                }
            }
        }
        else 
SendClientMessage(playerid0xFF0000FF"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!