/places
#1

Hey guys i have a aquestion , why my cmd dont works for me?

PHP код:
CMD:places(playerid)
{
ShowPlayerDialog(playeridDIALOG_PLACESDIALOG_STYLE_LIST"Places Menu""Los Santos\nSan Fierro\nLas Venturas""Go""Cancel");
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_PLACES)
    {
        if(
response
        {
            
            switch(
listitem)
            {
                case 
0SetPlayerPos(playerid1258.7352,-2036.7100,59.4561);
                case 
1SetPlayerPos(playerid, -2018.0339,145.6004,27.9839);
                case 
2SetPlayerPos(playerid2034.0673,1007.7039,10.8203);
            }
        }
        return 
1
    }
    return 
0;

Код:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(236) : error 029: invalid expression, assumed zero
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(258) : warning 203: symbol is never used: "places"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

i think you need return 1 in your command.

CMDlaces(playerid)
{
ShowPlayerDialog(playerid, DIALOG_PLACES, DIALOG_STYLE_LIST, "Places Menu", "Los Santos\nSan Fierro\nLas Venturas", "Go", "Cancel");
return 1;
}
Reply
#3

pawn Код:
CMD:places(playerid, params[])
{
    ShowPlayerDialog(playerid, DIALOG_PLACES, DIALOG_STYLE_LIST, "Places Menu", "Los Santos\nSan Fierro\nLas Venturas", "Go", "Cancel");
    return 1;
}
You should read the syntax.

--

Which of those is line 258?
Reply
#4

Others have corrected you but this
Quote:

C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(25 : warning 203: symbol is never used: "places"

seems like you have not include "zcmd" or any other command processor with same syntax
Reply
#5

Код:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(236) : error 029: invalid expression, assumed zero
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(236) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(236) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(236) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(236) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(236) : warning 215: expression has no effect
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(236) : error 001: expected token: ";", but found ")"
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(236) : error 029: invalid expression, assumed zero
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\register.pwn(236) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
line 236

PHP код:
ShowPlayerDialog(playeridDIALOG_PLACESDIALOG_STYLE_LIST"Places Menu""Los Santos\nSan Fierro\nLas Venturas""Go""Cancel");
    return 
1
Reply
#6

What command processor are you using? Did you include it at the top of the script?
Reply
#7

PHP код:
#include <a_samp>
#include <sscanf2>
#include <YSI\y_ini>
#include <zcmd>
#include <foreach> 
i got this
Reply
#8

solved.

idk if its the correct way but it works with this:

PHP код:
CMD:places(playerid)
    {
       if(
PlayerInfo[playerid][pAdmin] >= 3)
       {
          
ShowPlayerDialog(playerid,200,DIALOG_STYLE_LIST"Admin Places Menu""Los Santos \nSan Fierro \nLas Venturas""Go""Cancel");
       }
       else
       {
          
SendClientMessage(playeridCOLOR_CORRECTION"You are not authorized to use this command !");
       }
       return 
1;
    }
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 200)
    {
          if(
response)
          {
            if(
listitem == 0)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid1539.0920,-1675.8379,13.5469);
               
SendClientMessage(playeridCOLOR_SUCCESS" You Have Been Teleported Los Santos" );
            }
            if(
listitem == 1)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid, -1410.2748,-308.2696,14.1411);
               
SendClientMessage(playeridCOLOR_SUCCESS" You Have Been Teleported San Fierro" );
            }
            if(
listitem == 2)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid2028.8151,1007.9219,10.8203);
               
SendClientMessage(playeridCOLOR_SUCCESS" You Have Been Teleported Las Venturas" );
            }
        }
    }

its okay or not?
Reply
#9

How many versions of /gotols are you going to have?

Seriously though, next time, be sure to include all the lines of code that are failing, including 3-5 lines before and after the errors.

Also highlighting the line that is erroring itself, so that people can see where it is would help out.



Like, your first post, you cover the first error, but the second error is further down from the code you provided, and I'm sure you problem relates back to the FIRST thread we conversed about....



Where someone kept telling you about your if structure being incorrect, and I'm sure that this, is very much related. Not just an if statement though, more the fact that you don't use indentation, and aren't seeing the problems that others point out.
Reply
#10

I decide to use this structure, but i dont know if its the correct way:

PHP код:
CMD:places(playerid)
    {
       if(
PlayerInfo[playerid][pAdmin] >= 420)
       {
          
ShowPlayerDialog(playerid,200,DIALOG_STYLE_LIST"                              {0092FF}Admin Places Menu""Los Santos \nSan Fierro \nLas Venturas \nDillimore \nBlueberry \nMontgomery \nPalomino Creek \nAngel Pine \nBayside \nEl Quebrado \nLas Barrancas \nFort Carson \nLas Payasadas \nMount Chiliad \nCounty General Hospital \nAll Saints General Hospital \nHitman Head Quarters \nHitman Secondary Head Quarters \nFort DeMorgan""Go""Cancel");
       }
       else
       {
          
SendClientMessage(playeridCOLOR_CORRECTION"You are not authorized to use this command !");
       }
       return 
1;
    } 
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 200)
    {
          if(
response)
          {
            if(
listitem == 0)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid1258.7352,-2036.7100,59.4561);
               
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Los Santos !" );
            }
            if(
listitem == 1)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid, -2018.0339,145.6004,27.9839);
               
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to San Fierro !" );
            }
            if(
listitem == 2)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid2028.8151,1007.9219,10.8203);
               
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Las Venturas !" );
            }
            if(
listitem == 3)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid700.7490,-464.1175,16.3359);
               
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Dillimore !" );
            }
            if(
listitem == 4)
            {
               
SetPlayerInterior(playerid0);
               
SetPlayerPos(playerid175.4555,-148.2676,1.5781);
               
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Blueberry !" );
            }
            if(
listitem == 5)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid1355.9956,252.8677,19.5547);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Montgomery !");
            }
            if(
listitem == 6)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid2273.0762,-84.6477,26.5138);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Palomino Creek !");
            }
            if(
listitem == 7)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -2164.1357,-2388.7588,30.6250);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Angel Pine !");
            }
            if(
listitem == 8)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -2262.6235,2319.2014,4.8125);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Bayside !");
            }
            if(
listitem == 9)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -1485.6838,2662.0139,55.8359);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to El Quebrado !");
            }
            if(
listitem == 10)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -836.9157,1526.6680,21.5830);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Las Barrancas !");
            }
            if(
listitem == 11)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -201.8772,1119.2716,19.7422);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Fort Carson !");
            }
            if(
listitem == 12)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -236.2037,2626.6682,62.7411);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Las Payasadas !");
            }
            if(
listitem == 13)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -2234.0476,-1736.3102,480.8173);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Mount Chiliad !");
            }
            if(
listitem == 14)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid2041.7695,-1413.9603,17.1708);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to County General Hospital !");
            }
               if(
listitem == 15)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid1184.2737,-1316.9083,13.5732);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to All Saints General Hospital !");
            }
            if(
listitem == 16)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid, -706.1820,965.1531,12.4496);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Hitman Head Quarters !");
            }
            if(
listitem == 17)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid261.7835,2899.4849,8.7624);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Hitman Secondary Head Quarters !");
            }
            if(
listitem == 18)
            {
            
SetPlayerInterior(playerid0);
            
SetPlayerPos(playerid107.2300,1920.6311,18.5208);
            
SendClientMessage(playeridCOLOR_SUCCESS"You have been teleported to Fort DeMorgan !");
            }
        }
    }

I dont know if i missed any thing, i would like if you help me, but the code have no errors for the moment and its working, but like i said before im new in this lenguage so i want to learn how can i do a better work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)