Where to put that CMD ?
#1

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
Reply
#2

OnPlayerCommandText or OnPlayerCommandPerformed
Reply
#3

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

Do you mean that the syntax is wrong ?
Reply
#5

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.
Reply
#6

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

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 ?
Reply
#8

EDIT:
dont worry
Reply
#9

Don't put it on any callback
Reply
#10

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


Forum Jump:


Users browsing this thread: 4 Guest(s)