en que estoy mal????
#1

estoy desesperado en que estoy mal noce..............

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
//---------------dm sniper----------------//

enum Jugador;
{
   Juegos
};

new JugadorInfo[MAX_PLAYERS][Jugador];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(JugadorInfo[playerid][Juegos] == 1) return SendClientMessage(playerid, COLOR_RED, "*Estas en minijuego no puedes usar cmds usa /kill si quieres salir o espera que te maten.");

    if(strcmp(cmdtext, "/dmsniper", true) == 0)
    {
        SetPlayerArmour(playerid, 100.0);
        GivePlayerWeapon(playerid, 34, 3000);
        SetPlayerVirtualWorld(playerid,1);
        JugadorInfo[playerid][Juegos] = 1;
        return 1;
    }

    return 0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    JugadorInfo[playerid][Juegos] = 0;
    SetPlayerVirtualWorld(playerid,0);
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
      if(strcmp(cmdtext, "/dmsniper", true) == 9999) // cambialo por el que quieras
      {
        ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"dmsniper","","1- Derecha","2- Izquierda"); // el 0 es la id del dialog, cambiala a la que quieras
        return 1;
      }
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9999) // si el dialog es 0, si lo cambiaste, cambialo aca tambien
{
if(response == 0) // si pone "derecha"
{
SetPlayerPos(playerid,2196.9271785156,1110.7529296875,284.5651550293); // aca hace el teleport a la derecha
}
if(response == 1) // si pone izquierda
{
SetPlayerPos(playerid,2319.1496582031,1056.0446777344,288.71640014648); // aca hace el teleport a la izquierda
}
return 1;
}
return 1;
}
}
si esto es asi y esto igual....
pawn Код:
public OnGameModeInit()

{
new string[MAX_PLAYER_NAME];
 CreateObject(8498,2231.13232422,1034.94677734,115.30249786,0.00000000,0.00000000,0.00000000); //object(exclbr_hotl01_lvs) (1)
 CreateObject(8498,2230.76391602,1034.51806641,182.19445801,0.00000000,0.00000000,0.00000000); //object(exclbr_hotl01_lvs) (2)
 CreateObject(8498,2230.85302734,1033.70727539,250.14691162,0.00000000,0.00000000,0.00000000); //object(exclbr_hotl01_lvs) (3)
 CreateObject(8499,2265.92285156,1130.58544922,117.73530579,0.00000000,0.00000000,0.00000000); //object(exclbr_hotl02_lvs) (1)
 CreateObject(8499,2265.31738281,1130.29003906,254.05192566,0.00000000,0.00000000,0.00000000); //object(exclbr_hotl02_lvs) (2)
 CreateObject(8657,2185.57641602,1064.15600586,281.06878662,0.00000000,0.00000000,21.89999390); //object(shbbyhswall10_lvs) (1)
 CreateObject(8657,2196.98657227,1035.57922363,281.06878662,0.00000000,0.00000000,21.89575195); //object(shbbyhswall10_lvs) (2)
 CreateObject(5481,2198.14355469,1016.45703125,275.55505371,4.99877930,1.99951172,168.89831543); //object(laebridge) (1)
 CreateObject(5481,2288.30151367,1151.53820801,281.13305664,10.99731445,353.99597168,350.99670410); //object(laebridge) (2)
 CreateObject(8499,2265.00854492,1129.79882812,188.08303833,0.00000000,0.00000000,0.00000000); //object(exclbr_hotl02_lvs) (2)
 CreateObject(5481,2191.63330078,1109.11608887,277.65707397,4.99877930,1.99951172,261.09997559); //object(laebridge) (1)
 CreateObject(5481,2304.49536133,1052.67187500,281.74581909,4.99328613,1.99951172,261.09558105); //object(laebridge) (1)
}

en que coсo estoy mal -.-!!!!!!!!! ayudaaaaaaa prota respuesta
Reply
#2

Por quй tenes 3 veces el callback OnPlayerCommandText?

Por quй tenes todos los callbacks dentro de OnPlayerCommandText (inluyendo otros 2 OnPlayerCommandText)?

Te sugiero que leas tutoriales, dado que se nota que no tenes mucha idea de la estructura de pawn. o no habrias hecho lo que hiciste.



Aca te dejo como iria funcional.
pawn Код:
new bool:Juegos[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(Juegos[playerid])return SendClientMessage(playerid, COLOR_RED, "*Estas en minijuego no puedes usar cmds usa /kill si quieres salir o espera que te maten.");

    if(!strcmp(cmdtext, "/dmsniper", true)){
        SetPlayerArmour(playerid, 100.0);
        GivePlayerWeapon(playerid, 34, 3000);
        SetPlayerVirtualWorld(playerid, 1);
        return Juegos[playerid] = true;
    }
    else if(!strcmp(cmdtext, "/dmsniper2", true))return ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "dmsniper", "" , "1- Derecha", "2- Izquierda");
    return 0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    Juegos[playerid] = false;
    return SetPlayerVirtualWorld(playerid, 0);
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 9999)return (!response) ? (SetPlayerPos(playerid,2196.9271785156,1110.7529296875,284.5651550293)) : (SetPlayerPos(playerid,2319.1496582031,1056.0446777344,288.71640014648));
    return 1;
}
Quote:
Originally Posted by cesar_******
Посмотреть сообщение
en que coсo estoy mal -.-!!!!!!!!!
EN TODO
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)