SA-MP Forums Archive
Want a little help (reward : +1 rep) - 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: Want a little help (reward : +1 rep) (/showthread.php?tid=325202)



Want a little help (reward : +1 rep) - XGTDM - 12.03.2012

i want a script so tht i can teleport to lsa, lva or sfa and on teleporting i should get the car spawning menu
i have it like this:
pawn Код:
CMD:lsa(playerid,params[]) {
    #pragma unused params
    if(AccInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape your punishment!");
    TeleTimer[playerid] = SetTimerEx("ttimer", 1000, true, "i",playerid);
    tseconds[playerid] = 0;
    format(tstring,45,"You Must wait %d seconds before teleporting", tseconds[playerid]-1);
    if(AccInfo[playerid][Level] == 0) SendClientMessage(playerid,COLOR_LIGHTBLUE, tstring);
    Tx[playerid] =1477.4083;
    Ty[playerid] =1761.8549;
    Tz[playerid] =10.8125;
    Ti[playerid] = 0;
    new string[128];
    new dsname[MAX_PLAYER_NAME];
    format(telestring,43,"Las Santos Airport!");
    GetPlayerName(playerid, dsname, sizeof(dsname));
    format(string, sizeof(string), "%s has just teleported to LS Airport /lsa", dsname);
    SendClientMessageToAll(COLOR_YELLOW, string);
    SetTimerEx("setstunt",3000,0,"i", playerid);
    ShowPlayerDialog( playerid, DIALOGID3+40, DIALOG_STYLE_LIST, "Vehicle Types", "nBikes\nConvertibles\nIndustrial\nLowriders\nOff Road\nPublic Service Vehicles\nSaloons\nSport Vehicles\nStation Wagons", "Select", "Cancel" );
    return 1;
}

CMD:sfa(playerid,params[]) {
    #pragma unused params
    if(AccInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape your punishment!");
    TeleTimer[playerid] = SetTimerEx("ttimer", 1000, true, "i",playerid);
    tseconds[playerid] = 6;
    format(tstring,45,"You Must wait %d seconds before teleporting", tseconds[playerid]-1);
    if(AccInfo[playerid][Level] == 0) SendClientMessage(playerid,COLOR_LIGHTBLUE, tstring);
    Tx[playerid] =-1657.5400;
    Ty[playerid] =-164.9457;
    Tz[playerid] =14.1484;
    Ti[playerid] = 0;
    new string[128];
    new dsname[MAX_PLAYER_NAME];
    format(telestring,43,"San Fierro Airport!");
    GetPlayerName(playerid, dsname, sizeof(dsname));
    format(string, sizeof(string), "%s has just teleported to SF Airport /sfa", dsname);
    SendClientMessageToAll(COLOR_YELLOW, string);
    SetTimerEx("setstunt",3000,0,"i", playerid);
    ShowPlayerDialog( playerid, DIALOGID3+40, DIALOG_STYLE_LIST, "Vehicle Types", "nBikes\nConvertibles\nIndustrial\nLowriders\nOff Road\nPublic Service Vehicles\nSaloons\nSport Vehicles\nStation Wagons", "Select", "Cancel" );
    return 1;
}

CMD:lva(playerid,params[]) {
    #pragma unused params
    if(AccInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape your punishment!");
    TeleTimer[playerid] = SetTimerEx("ttimer", 1000, true, "i",playerid);
    tseconds[playerid] = 6;
    format(tstring,45,"You Must wait %d seconds before teleporting", tseconds[playerid]-1);
    if(AccInfo[playerid][Level] == 0) SendClientMessage(playerid,COLOR_LIGHTBLUE, tstring);
    Tx[playerid] =1477.4083;
    Ty[playerid] =1761.8549;
    Tz[playerid] =10.8125;
    Ti[playerid] = 0;
    new string[128];
    new dsname[MAX_PLAYER_NAME];
    format(telestring,43,"Las Venturas Airport!");
    GetPlayerName(playerid, dsname, sizeof(dsname));
    format(string, sizeof(string), "%s has just teleported to LV Airport /lva", dsname);
    SendClientMessageToAll(COLOR_YELLOW, string);
    SetTimerEx("setstunt",3000,0,"i", playerid);
    ShowPlayerDialog( playerid, DIALOGID3+40, DIALOG_STYLE_LIST, "Vehicle Types", "nBikes\nConvertibles\nIndustrial\nLowriders\nOff Road\nPublic Service Vehicles\nSaloons\nSport Vehicles\nStation Wagons", "Select", "Cancel" );
    return 1;
}
But in this code the vehicle selection dialog appears before teleporting

i want the same type of script so tht after teleporting this same menu appears

plls help


Re: Want a little help (reward : +1 rep) - Sinner - 12.03.2012

pawn Код:
// Show the dialog when using the commands:
// so for example: lsa

dcmd_lsa(playerid, params[]) {
    #pragma unused params
    ShowPlayerDialog( playerid, DIALOGID3+40, DIALOG_STYLE_LIST, "Vehicle Types", "nBikes\nConvertibles\nIndustrial\nLowriders\nOff Road\nPublic Service Vehicles\nSaloons\nSport Vehicles\nStation Wagons", "Select", "Cancel" );  
}

// then when a player chose a vehicle, teleport them (use OnDialogResponse)

public OnDialogResponse(playerid, dialogid, ...) {
    if(dialogid == DIALOGID3+40) {
        if(response) {
            // teleport them
        }
    }
}
DO this for all three teleports


Re: Want a little help (reward : +1 rep) - XGTDM - 12.03.2012

thnxx 4 de help +rep 4 u