Car Plates Help !
#1

Command:

pawn Код:
if(strcmp(cmd, "/tablicki", true) == 0)
        {
        if(gPlayerLogged[playerid] = 0)
        {
        SCM(playerid,COLOR_WHITE, "{FF4040}GRESKA:{FFFFFF}Seuste ne ste Logiran!");
        }
        ShowPlayerDialog(playerid, 123456, DIALOG_STYLE_INPUT, "{FFFFFF}Change your vehicle number plate","{FFFFFF}Please enter your desired text for your vehicle number plate.","Set","Cancel");
        return 1;
  }
Dialog:

pawn Код:
if(dialogid == 123456)
        {
        if(response)
        {
            SetVehicleNumberPlate(playerVeh, inputtext);
            GetPlayerPos(playerid, vehPos[0], vehPos[1], vehPos[2]);
            GetVehicleZAngle(playerVeh, vehPos[3]);
            SetVehicleToRespawn(playerVeh);
            SetVehiclePos(playerVeh, vehPos[0], vehPos[1], vehPos[2] );
            SetVehicleZAngle(playerVeh, vehPos[3]);
            }
            else
            {
            SendClientMessage(playerid, COLOR_WHITE, "{37F906}INFO:{FFFFFF}Mora da imate tablicka!");
            return 1;
            }
            return 1;
            }
And now how to set to this.When i type /tablicki dialog dont show, help me to show dialog and change car plates please.GIVING REP ++ WHO HELP ME !
Reply
#2

try this:

pawn Код:
if(strcmp(cmd, "/tablicki", true) == 0)
{
    if(gPlayerLogged[playerid] == 0)
    {
        SCM(playerid,COLOR_WHITE, "{FF4040}GRESKA:{FFFFFF}Seuste ne ste Logiran!");
    }
    else if(gPlayerLogged[playerid] == 1)
    {
        ShowPlayerDialog(playerid, 123456, DIALOG_STYLE_INPUT, "{FFFFFF}Change your vehicle number plate","{FFFFFF}Please enter your desired text for your vehicle number plate.","Set","Cancel");
    }
    return 1;
}
pawn Код:
if(dialogid == 123456)
{
    if(response)
    {
        SetVehicleNumberPlate(playerVeh, inputtext);
        GetPlayerPos(playerid, vehPos[0], vehPos[1], vehPos[2]);
        GetVehicleZAngle(playerVeh, vehPos[3]);
        SetVehicleToRespawn(playerVeh);
        SetVehiclePos(playerVeh, vehPos[0], vehPos[1], vehPos[2] );
        SetVehicleZAngle(playerVeh, vehPos[3]);
        PutPlayerInVehicle(playerid, PlayerVeh, 0);
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "{37F906}INFO:{FFFFFF}Mora da imate tablicka!");
    }
    return 1;
}
UNTESTED!, also i put 1 line extra at the ondialogresponse, so that the player will automaticcally be put back in his car.

this should work
Reply
#3

pawn Код:
if(strcmp(cmd, "/tablicki", true) == 0)
{
    if(!gPlayerLogged[playerid]) return SCM(playerid,COLOR_WHITE, "{FF4040}GRESKA:{FFFFFF}Seuste ne ste Logiran!");
    if(!IsPlayerInAnyVehicle(playerid)) return 1;
    ShowPlayerDialog(playerid, 123456, DIALOG_STYLE_INPUT, "{FFFFFF}Change your vehicle number plate","{FFFFFF}Please enter your desired text for your vehicle number plate.","Set","Cancel");
    return 1;
}
pawn Код:
if(dialogid == 123456 && response)
{
    SetVehicleNumberPlate(playerVeh, inputtext);
    GetPlayerPos(playerid, vehPos[0], vehPos[1], vehPos[2]);
    GetVehicleZAngle(playerVeh, vehPos[3]);
    SetVehicleToRespawn(playerVeh);
    SetVehiclePos(playerVeh, vehPos[0], vehPos[1], vehPos[2] );
    SetVehicleZAngle(playerVeh, vehPos[3]);
    PutPlayerInVehicle(playerid, PlayerVeh, 0);
}
untested
Reply
#4

^^ you left a part at dialog, it should also send a message if it didnt respond...

anyways your command part is better, some better checks, so i recommend teomakedonia to use my dialogresponse, and kael his command part
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)