Command Problem
#1

Hey, this is my 3 commands.../teleports and /prikazy1 are working but the third one /prikazy2 is not...and i don't know why.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/teleports", cmdtext, true, 10) == 0)
        {
                ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"{9D0000}Te{FFFFFF}le{9D0000}po{FFFFFF}rt{9D0000}y","{FFFF00}Pershing {FFFFFF}Square\n{FFFF00}Groove {FFFFFF}Street\n{FFFF00}Temple {FFFFFF}Drive\n{FFFF00}Verona {FFFFFF}Beatch\n{FFFF00}Vysoky {FFFFFF}Zoskok","Teleport","Odchod");
                return 1;
        }
        if (strcmp(cmdtext, "/prikazy1", true) == 0)
                ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Moderбtor - Prнkazy","Level 1:\n\n/getinfo\n/weaps\n/ping\n/ip\n/fix\n/repair\n/addnos\n/tcar\n/savepleace\n/gotoplace\n/onduty\n/saveskin\n/useskin\n/dontuseskin\n/setmytime\n/adminarea\n/lconfig\n/viplist\n/morning\n/reports\n/richlist\n/miniguns","OK","OK");
		return 1;
 	  	}
 	  	if (strcmp(cmdtext, "/prikazy2", true) == 0)
                ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Moderбtor Level 2 - Prнkazy","Level 2:\n\n+Level 1 prнkazy\n\n/giveweapon\n/setcolour\n/burn\n/spawn\n/disarm\n/highlight\n/jetpack\n/flip\n/fu\n/warn\n/slap\n//(un)mute\n/laston\n/lspec\n/lspecoff\n/acar\n/abike\n/aboat\n/aplane\n/lspecvehicle\n/goto\n/vgoto\n/lgoto\n/lmenu\n/clearchat\n/write\n/announce\n/announce2\n/screen\n/(un)lockcar\n/wanted\n/jailed\n/frozen\n/muted\n/fstyles","OK","OK");
		return 1;
it is showing the error on: if (strcmp(cmdtext, "/prikazy2", true) == 0)
: return 1;
Reply
#2

Whats the error? Show me please
Reply
#3

Код:
C:\Users\kjn\Documents\Server\gamemodes\kjn.pwn(354) : error 010: invalid function or declaration
C:\Users\kjn\Documents\Server\gamemodes\kjn.pwn(356) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#4

pawn Код:
public
    OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/teleports", cmdtext) == 0)
    {
        ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"{9D0000}Te{FFFFFF}le{9D0000}po{FFFFFF}rt{9D0000}y","{FFFF00}Pershing {FFFFFF}Square\n{FFFF00}Groove {FFFFFF}Street\n{FFFF00}Temple {FFFFFF}Drive\n{FFFF00}Verona {FFFFFF}Beatch\n{FFFF00}Vysoky {FFFFFF}Zoskok","Teleport","Odchod");
        return 1;
    }
   
    if(strcmp(cmdtext, "/prikazy1") == 0)
    {
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Moderбtor - Prнkazy","Level 1:\n\n/getinfo\n/weaps\n/ping\n/ip\n/fix\n/repair\n/addnos\n/tcar\n/savepleace\n/gotoplace\n/onduty\n/saveskin\n/useskin\n/dontuseskin\n/setmytime\n/adminarea\n/lconfig\n/viplist\n/morning\n/reports\n/richlist\n/miniguns","OK","OK");
        return 1;
    }
   
    if(strcmp(cmdtext, "/prikazy2") == 0)
    {
        ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Moderбtor Level 2 - Prнkazy","Level 2:\n\n+Level 1 prнkazy\n\n/giveweapon\n/setcolour\n/burn\n/spawn\n/disarm\n/highlight\n/jetpack\n/flip\n/fu\n/warn\n/slap\n//(un)mute\n/laston\n/lspec\n/lspecoff\n/acar\n/abike\n/aboat\n/aplane\n/lspecvehicle\n/goto\n/vgoto\n/lgoto\n/lmenu\n/clearchat\n/write\n/announce\n/announce2\n/screen\n/(un)lockcar\n/wanted\n/jailed\n/frozen\n/muted\n/fstyles","OK","OK");
        return 1;
    }
    return 0;
}
Reply
#5

Try to change Change it do this :

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp("/teleports", cmdtext, true, 10) == 0)
        {
                ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"{9D0000}Te{FFFFFF}le{9D0000}po{FFFFFF}rt{9D0000}y","{FFFF00}Pershing {FFFFFF}Square\n{FFFF00}Groove {FFFFFF}Street\n{FFFF00}Temple {FFFFFF}Drive\n{FFFF00}Verona {FFFFFF}Beatch\n{FFFF00}Vysoky {FFFFFF}Zoskok","Teleport","Odchod");
                return 1;
        }
        if (strcmp(cmdtext, "/prikazy1", true) == 0)
                ShowPlayerDialog(playerid,0,DIALOG_STYLE_LIST,"Moderбtor - Prнkazy","Level 1:\n\n/getinfo\n/weaps\n/ping\n/ip\n/fix\n/repair\n/addnos\n/tcar\n/savepleace\n/gotoplace\n/onduty\n/saveskin\n/useskin\n/dontuseskin\n/setmytime\n/adminarea\n/lconfig\n/viplist\n/morning\n/reports\n/richlist\n/miniguns","OK","OK");
        return 1;
        }
        if (strcmp(cmdtext, "/prikazy2", true) == 0)
                ShowPlayerDialog(playerid,0,DIALOG_STYLE_LIST,"Moderбtor Level 2 - Prнkazy","Level 2:\n\n+Level 1 prнkazy\n\n/giveweapon\n/setcolour\n/burn\n/spawn\n/disarm\n/highlight\n/jetpack\n/flip\n/fu\n/warn\n/slap\n//(un)mute\n/laston\n/lspec\n/lspecoff\n/acar\n/abike\n/aboat\n/aplane\n/lspecvehicle\n/goto\n/vgoto\n/lgoto\n/lmenu\n/clearchat\n/write\n/announce\n/announce2\n/screen\n/(un)lockcar\n/wanted\n/jailed\n/frozen\n/muted\n/fstyles","OK","OK");
        return 1;
Reply
#6

smeti...i love you man
Reply
#7

Maybe some of the code forms broke, that usually happens.
Reply
#8

one more question...sometimes it says that the line in pawno is too long. how to make it smaller then_ for example this line here.

Код:
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Moderбtor Level 2 - Prнkazy","Level 2:\n\n+Level 1 prнkazy\n\n/giveweapon\n/setcolour\n/burn\n/spawn\n/disarm\n/highlight\n/jetpack\n/flip\n/fu\n/warn\n/slap\n//(un)mute\n/laston\n/lspec\n/lspecoff\n/acar\n/abike\n/aboat\n/aplane\n/lspecvehicle\n/goto\n/vgoto\n/lgoto\n/lmenu\n/clearchat\n/write\n/announce\n/announce2\n/screen\n/(un)lockcar\n/wanted\n/jailed\n/frozen\n/muted\n/fstyles","OK","OK");
Reply
#9

Use strcat, Example :

pawn Код:
new string[300];
strcat(string, "Word\n");
strcat(string, "Word\n");
strcat(string, "Word\n");
strcat(string, "Word\n");
strcat(string, "Word\n");
strcat(string, "Word\n");
strcat(string, "Word\n");
ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, "Hmm", string, "Close", "");
Reply
#10

so if i got this

Код:
if(strcmp(cmdtext, "/prikazy3") == 0)
    {
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Moderбtor Level 3 - Prнkazy","Level 3:\n\n+Level 1 Prнkazy\n+Level 2 prнkazy\n/set (health/armour/cash/score/skin/wanted/name/weather/time/world/interior/ping/gravity\n/setallskin\n/armourall\n/setallwanted\n/setallweather\n/setalltime\n/setallworld\n/setallscore\n/setallcash\n/giveallweapon\n/clearallchat\n/healall\n/diseblechat\n/ubound\n/duel\n/akill\n/aka\n/caps\n/(un)freeze\n/kick\n/explode\n/(un)jail\n/force\n/eject\n/(s)removecash\n/car\n/carhealth\n/carcolour\n/destroycar\n/vget\n/givecar\/teleplayer\n/gethere\n/get\n/move\n/moveplayer\n/gps\n/lcam\n/setpass\n/lammo\n/countdown\n/aweaps\n/invisible\n/visible","OK","OK");
        return 1;
    }
    return 0;
how should it looks like?
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)