[Pomoc]trebam pomoc oko jednog dialoga

Započeo gamer13915, Novembar 11, 2012, 12:53:53 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Može li mi netko reci sto ovdje nevalja, Početnik sam pa neznam baš puno
public OnPlayerCommandText(playerid, cmdtext[])
{
   if (strcmp("/teleport", cmdtext, true, 10) == 0) //ovu  zanemarite to je za teleportiranje na neku zgradu
    if (strcmp("/Teleport1",cmdtext, true, 10) == 0) /ovo je ta komanda koju kada upiÅ¡em treba mi se pokazati dialog  pokazati
   {
        ShowPlayerDialog(playerid, 20323, DIALOG_STYLE_LIST, "Teleport", "Planina\nWinewood\nGranica", "Teleport", "Exit");
        SetPlayerPos(playerid,1674.2566,-1401.9370, 84.6563);
        SetPlayerInterior(playerid,0);
      return 1;
   }
   return 0;
}



public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 20322 && response)
{
   switch(listitem)
   {
     case 0:
      {
        ShowPlayerDialog(playerid, 20323, DIALOG_STYLE_LIST, "Teleport", "Planina\nWinewood\nGranica", "Teleport", "Exit");
      }
    }
}
if(dialogid == 20323 && response)
    {
      switch(listitem)
      {
        case 0:
        {
        SetPlayerPos(playerid, 1061.2413,-47.2393,84.6550);
        SetPlayerInterior(playerid,0);
        SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to Planina");
        }
        case 1:
        {
        SetPlayerPos(playerid, 1385.3440,-800.8142,80.3001);
        SetPlayerInterior(playerid,0);
        SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to Winewood");
        }
        case 2:
        {
       SetPlayerPos(playerid, 177.7764,-1414.6920,45.1587);
       SetPlayerInterior(playerid,0);
       SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to Granica");
        }
      }
    }
    return 1;
   }
Izbacuje mi ovaj error kada hocu compilat
G:\Gabriel\samp03e_svr_R2_win32\gamemodes\Test1.pwn(287) : warning 217: loose indentation
G:\Gabriel\samp03e_svr_R2_win32\gamemodes\Test1.pwn(293) : warning 203: symbol is never used: "Dominating"
G:\Gabriel\samp03e_svr_R2_win32\gamemodes\Test1.pwn(293) : warning 203: symbol is never used: "PlayerKills"
Poslednja Izmena: Novembar 11, 2012, 12:58:57 POSLE PODNE od gamer13915

Prvi warning te upozorava da poredjas lepo linije, a ova errora ti pokazuju da se ne koriste te stvari koje imas definirane, samo ih deletaj

 kazes da obrisem ovo new PlayerKills[MAX_PLAYERS] = 0, D[MAX_PLAYERS] = 0;     



napravio sam sve i kada uÄ'em na localhost server i upisem ovu komandu /Teleport pise SERVER:Unknown command

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/teleport", cmdtext, true, 10) == 0)
if (strcmp("/Teleport", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 20323, DIALOG_STYLE_LIST, "Teleport1", "Planina\nWinewood\nGranica", "Teleport", "Exit");
SetPlayerPos(playerid,1674.2566,-1401.9370, 84.6563);
SetPlayerInterior(playerid,0);
return 1;
}
return 0;
}



i ovo drugo sam poredao
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

        public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
        {
        if(dialogid == 20322 && response)
        {
       switch(listitem)
       {
       case 0:
        {
        ShowPlayerDialog(playerid, 20323,  DIALOG_STYLE_LIST, "Teleport", "Planina\nWinewood\nGranica", "Teleport", "Exit");
        }
        }
        }
        if(dialogid == 20323 && response)
        {
        switch(listitem)
        {
        case 0:
        {
        SetPlayerPos(playerid, 1061.2413,-47.2393,84.6550);
        SetPlayerInterior(playerid,0);
        SendClientMessage(playerid, COLOR_YELLOW , "You have been teleported to Planina");
        }
        case 1:
        {
        SetPlayerPos(playerid, 1385.3440,-800.8142,80.3001);
        SetPlayerInterior(playerid,0);
        SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to Winewood");
        }
        case 2:
        {
       SetPlayerPos(playerid, 177.7764,-1414.6920,45.1587);
       SetPlayerInterior(playerid,0);
       SendClientMessage(playerid, COLOR_YELLOW, "You have been teleported to Granica");
        }
        }
        }
        return 1;
       }
    


Poslednja Izmena: Novembar 11, 2012, 13:28:23 POSLE PODNE od gamer13915

Komanda treba da ti izgleda ovako if (strcmp("/teleport", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 20323, DIALOG_STYLE_LIST, "Teleport1", "Planina\nWinewood\nGranica", "Teleport", "Exit");
SetPlayerPos(playerid,1674.2566,-1401.9370, 84.6563);
SetPlayerInterior(playerid,0);
return 1;
}
return 0;
}

Kako onda kada pravim obicnu komandu za teleport  gdje to trebam pisat ? jel ispod ove komande?
Hvala na pomoci


jel ovako
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/teleport", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 20323, DIALOG_STYLE_LIST, "Teleport", "Planina\nWinewood\nGranica", "Teleport", "Exit");
{
if (strcmp("/teleport2", cmdtext, true, 10 ) == 0)
SetPlayerPos(playerid,1674.2566,-1401.9370, 84.6563);
SetPlayerInterior(playerid,0);
}
return 1;
}
return 0;
}

Ne, ne mozes tako, moras jednu ispod druge ovako  if (strcmp("/teleport", cmdtext, true, 10) == 0)
{
    GivePlayerMoney(playerid,999);
    SendClientMessage(playerid,-1,"Dao si 999 $.");
    return 1;
}
if (strcmp("/teleport", cmdtext, true, 10) == 0)
{
    GivePlayerMoney(playerid,999);
    SendClientMessage(playerid,-1,"Dao si 999 $.");
    return 1;
}