SA-MP Forums Archive
Where to put that CMD ? - 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: Where to put that CMD ? (/showthread.php?tid=396359)



Where to put that CMD ? - Red_Dragon. - 30.11.2012

Hello, i have a small problem with this command in my server, i tried to make it but here its define
pawn Код:
#define VSTORAGE 19104
and here is the command
pawn Код:
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;
}
Where to put it if i want it in a filterscript not a gamemode so where to place it ? and if anyone see something wrong in that code please tell


Re: Where to put that CMD ? - teomakedonija - 30.11.2012

OnPlayerCommandText or OnPlayerCommandPerformed


Re: Where to put that CMD ? - Faisal_khan - 30.11.2012

There is nothing under the command. If its ZCMD, then you don't need to put it under any callbacks.


Re: Where to put that CMD ? - Red_Dragon. - 30.11.2012

Do you mean that the syntax is wrong ?


Re: Where to put that CMD ? - thefatshizms - 30.11.2012

As faisal said, there is nothing under the command ie the command is not finished. Can you show the rest of it? This surely cant be it as this would give errors.


Re: Where to put that CMD ? - Faisal_khan - 30.11.2012

The command should be something like this:
pawn Код:
CMD:vstorage(playerid, params[])
{
    //your code here
    return 1;
}



Re: Where to put that CMD ? - Red_Dragon. - 30.11.2012

pawn Код:
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;
}
Like this one ?


Re: Where to put that CMD ? - thefatshizms - 30.11.2012

EDIT:
dont worry


Re: Where to put that CMD ? - Plovix - 30.11.2012

Don't put it on any callback


Re: Where to put that CMD ? - NumbSkull - 30.11.2012

if(dialogid == VSTORAGE 19104) <---------
just ------------>if(dialogid == VSTORAGE)