Vehicle Storage Problem
#1

Hello there. My vehicle storage system dosent work as it could.
When i do /vstorage is shows the vehicles as stored.

And when i do /vstorage and try to store and destore them it dosent work.
Could some one help me?

Код:
#define VSTORAGE 19104
Код:
CMD:vstorage(playerid, params[])
{
	new vstring[1024];
	for(new i, iModelID; i < MAX_PLAYERVEHICLES; i++) {
		if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0) {
			if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
				format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[iModelID]);
			}
			else if(PlayerVehicleInfo[playerid][i][pvDisabled]) {
				format(vstring, sizeof(vstring), "%s\n%s (disabled)", vstring, VehicleName[iModelID]);
			}
			else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) {
				format(vstring, sizeof(vstring), "%s\n%s (stored)", vstring, VehicleName[iModelID]);
			}
			else format(vstring, sizeof(vstring), "%s\n%s (spawned)", vstring, VehicleName[iModelID]);
		}
		else strcat(vstring, "\nEmpty");
	}
	ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "Vehicle storage", vstring, "(De)spawn", "Cancel");
	return 1;
}
Reply
#2

Add the OnDialogResponse part ? of you choose store or destore where is the response ?!?!?! https://sampwiki.blast.hk/wiki/OnDialogResponse
Reply
#3

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
Add the OnDialogResponse part ? of you choose store or destore where is the response ?!?!?! https://sampwiki.blast.hk/wiki/OnDialogResponse
Well, i don't really know where i could put the "OnDialogResponse".
That's why i'm asking for help, becouse i don't know what the problem is.
Reply
#4

Search for this in your script:
pawn Код:
OnDialogResponse
Then follow the tutorial in the wiki
Reply
#5

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
Search for this in your script:
pawn Код:
OnDialogResponse
Then follow the tutorial in the wiki
Tryd to follow the tuorial in the wiki page, dosent help.
Reply
#6

This is an example for what do you want:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == VSTORAGE 19104)
    {
        if(response)  
        {
           
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, WEAPON_DEAGLE, 14);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, WEAPON_AK47, 120);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 28);
            }
        }
        return 1;
    }
 
    return 0;
}
So now change the GivePlayerWeapon and its things to anything you want
Reply
#7

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
This is an example for what do you want:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == VSTORAGE 19104)
    {
        if(response)  
        {
           
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, WEAPON_DEAGLE, 14);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, WEAPON_AK47, 120);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 28);
            }
        }
        return 1;
    }
 
    return 0;
}
So now change the GivePlayerWeapon and its things to anything you want
Could it look somthing like this?

Код:
CMD:vstorage(playerid, params[])

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == VSTORAGE 19104)
	new vstring[1024];
	for(new i, iModelID; i < MAX_PLAYERVEHICLES; i++) {
		if((iModelID = PlayerVehicleInfo[playerid][i][pvModelId] - 400) >= 0) {
			if(PlayerVehicleInfo[playerid][i][pvImpounded]) {
				format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[iModelID]);
			}
			else if(PlayerVehicleInfo[playerid][i][pvDisabled]) {
				format(vstring, sizeof(vstring), "%s\n%s (disabled)", vstring, VehicleName[iModelID]);
			}
			else if(!PlayerVehicleInfo[playerid][i][pvSpawned]) {
				format(vstring, sizeof(vstring), "%s\n%s (stored)", vstring, VehicleName[iModelID]);
			}
			else format(vstring, sizeof(vstring), "%s\n%s (spawned)", vstring, VehicleName[iModelID]);
		}
		else strcat(vstring, "\nEmpty");
	}
	ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "Vehicle storage", vstring, "(De)spawn", "Cancel");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)