Open Dialog by every command
#1

hello.
I made yesterday a dialog (list) and now he just opening the dialog by every command.. It's very annoying so i want that it's stop. Can you help me?
My code:
A command:
Код:
    if (!strcmp("/r", cmdtext))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "Je bent niet in een voertuig.");
        RepairVehicle(GetPlayerVehicleID(playerid));
   	    GivePlayerMoney(playerid, -10000);
        SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} Voertuig gerepareert.");
        return 1;
    }
The dialog that open
Код:
ShowPlayerDialog(playerid,500,DIALOG_STYLE_LIST,"Server Control:","Tijd\nWeer\nZwaartekracht\nSkins\nGeld\nSpeler Marker\nServer Herstarten\nSever Afsluiten","Kies","Annuleren");
MathijsS
Reply
#2

Hey,

Try this maybe?

pawn Код:
if(strcmp(cmdtext, "/r", true) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "Je bent niet in een voertuig.");
        RepairVehicle(GetPlayerVehicleID(playerid));
        GivePlayerMoney(playerid, -10000);
        SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} Voertuig gerepareert.");
        return 1;
    }
Also, where are you opening the dialog? What command? You'll need to show that command as well.
Reply
#3

Quote:
Originally Posted by SlashQ
Посмотреть сообщение
Hey,

Try this maybe?

pawn Код:
if(strcmp(cmdtext, "/r", true) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "Je bent niet in een voertuig.");
        RepairVehicle(GetPlayerVehicleID(playerid));
        GivePlayerMoney(playerid, -10000);
        SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} Voertuig gerepareert.");
        return 1;
    }
Also, where are you opening the dialog? What command? You'll need to show that command as well.
that is a command where the dialog opens, weard
Reply
#4

Quote:
Originally Posted by MathijsS
Посмотреть сообщение
that is a command where the dialog opens, weard
Oh

Do you have any other /r commands in your script (or, beginning with r)? I think it's something to do with the length parameter in strcmp.
Reply
#5

Quote:
Originally Posted by SlashQ
Посмотреть сообщение
Oh

Do you have any other /r commands in your script (or, beginning with r)? I think it's something to do with the length parameter in strcmp.
must i place all my commands? It's big:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
	{
	if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid))
	{
		SendClientMessage(playerid, 0xFF0000FF, "[INFO] Je kan dat commando slechts om de seconde gebruiken");
	    return 1;
	}
	iPlayerChatTime[playerid] = GetTickCount();
	new cmd[256];
	new	tmp[256];
	new Message[256];
	new gMessage[256];
	new pName[MAX_PLAYER_NAME+1];
	new iName[MAX_PLAYER_NAME+1];
	new	idx;
	cmd = strtok(cmdtext, idx);
	if(strcmp("/pm", cmd, true) == 0)
	{
		tmp = strtok(cmdtext,idx);

		if(!strlen(tmp) || strlen(tmp) > 5) {
			SendClientMessage(playerid,ADMIN,"[INFO] /pm [id] [bericht]");
			return 1;
		}

		new id = strval(tmp);
        gMessage = strrest(cmdtext,idx);

		if(!strlen(gMessage)) {
			SendClientMessage(playerid,ADMIN,"[INFO] /pm [id] [bericht]");
			return 1;
		}

		if(!IsPlayerConnected(id)) {
			SendClientMessage(playerid,ADMIN,"[INFO] Player id klopt niet");
		}

		if(playerid != id) {
			GetPlayerName(id,iName,sizeof(iName));
			GetPlayerName(playerid,pName,sizeof(pName));
			format(Message,sizeof(Message),">> %s(%d): %s",iName,id,gMessage);
			SendClientMessage(playerid,PM_OUT,Message);
			format(Message,sizeof(Message),"** %s(%d): %s",pName,playerid,gMessage);
			SendClientMessage(id,PM_IN,Message);
			PlayerPlaySound(id,1085,0.0,0.0,0.0);

			printf("[PM] %s",Message);

		}
		else {
			SendClientMessage(playerid,ADMIN,"[INFO] Je kan jezelf geen pm's sturen");
		}
		return 1;
	}
	if(strcmp("/kick", cmd, true) == 0)
	{
	    if(IsPlayerAdmin(playerid)) {
			tmp = strtok(cmdtext,idx);
			if(!strlen(tmp) || strlen(tmp) > 5) {
				return SendClientMessage(playerid,ADMIN,"[INFO] /kick [id] [reden]");
			}

			new id = strval(tmp);

			if(!IsPlayerConnected(id)) {
				SendClientMessage(playerid,ADMIN,"[INFO] Player id klopt niet");
				return 1;
			}

			gMessage = strrest(cmdtext,idx);

			GetPlayerName(id,iName,sizeof(iName));
			SendClientMessage(id,ADMIN,">> Je bent gekickt van deze server.");

			if(strlen(gMessage) > 0) {
				format(Message,sizeof(Message),"[INFO] Reden %s",gMessage);
				SendClientMessage(id,ADMIN,Message);
			}

			format(Message,sizeof(Message),"[INFO] %s(%d) is gekickt",iName,id);
			SendClientMessage(playerid,ADMIN,Message);

			Kick(id);
			return 1;
		} else {
            SendClientMessage(playerid,ADMIN,"[INFO] /rcon login [password]");
			return 1;
		}
	}
	if(strcmp("/ban", cmd, true) == 0)
	{
	    if(IsPlayerAdmin(playerid)) {
			tmp = strtok(cmdtext,idx);
			if(!strlen(tmp) || strlen(tmp) > 5) {
				return SendClientMessage(playerid,ADMIN,"[INFO] /ban [id] [reden]");
			}

			new id = strval(tmp);

			if(!IsPlayerConnected(id)) {
				SendClientMessage(playerid,ADMIN,"[INFO] playerid klopt niet");
				return 1;
			}

			gMessage = strrest(cmdtext,idx);

			GetPlayerName(id,iName,sizeof(iName));
			SendClientMessage(id,ADMIN,">> Je bent gebant van deze server.");

			if(strlen(gMessage) > 0) {
				format(Message,sizeof(Message),"[INFO] Reden: %s",gMessage);
				SendClientMessage(id,ADMIN,Message);
			}

			format(Message,sizeof(Message),"[INFO] %s(%d) is verbannen",iName,id);
			SendClientMessage(playerid,ADMIN,Message);

			Ban(id);
			return 1;
		} else {
            SendClientMessage(playerid,ADMIN,"[INFO] /rcon login [password]");
			return 1;
		}
	}
//----------------------------------------------------------
	if (strcmp("/start", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}Welkom!");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}Dit is een freeroam server.");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}Dat je kan doen wat je wilt.");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}De basis commando's zijn:");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}                    /help /cmd /commands /rules /kitinfo");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}                    /register /login /stats");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}                    /v /t /h /a /kill");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}                    /kit1 /kit2 /kit3 /kit4 /kit5 /kit6");
		return 1;
	}
	if (strcmp(cmdtext, "/spawn", true) == 0)
    {
        SpawnPlayer(playerid);
        return 1;
    }
	if (strcmp("/help", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}Welkom bij {1AB109}G{FFFFFF}r{FF0000}a{FFFFFF}n{1AB109}d {1AB109}L{FFFFFF}a{FF0000}r{FFFFFF}c{1AB109}e{FFFFFF}n{FF0000}y");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/start voor meer info");
		return 1;
	}
	if (strcmp("/cmd", cmdtext, true, 5) == 0)
	{
		ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Commandos", "/start\n/help\n/spawn\n/cmd\n/kitinfo\n/h\n/a", "Ok", "Cancel");
		return 1;
	}
	if (strcmp("/weer", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}Weersomstandigheden:");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/w1: storm");
 		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/w2: mistig");
  		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/w3: heet (warmte golven)");
   		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/w4: zandstorm");
    	SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/w5: grijsachtig");
     	SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/w6: regenachtig");
		return 1;
	}
	if (strcmp("/tijd", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}Tijden");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/ochtent (06:00)");
 		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/middag (12:00)");
  		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/nacht (23:00)");
		return 1;
	}
	if (strcmp("/zwaartekrach", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}Zwaartekracht:");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/z1(+)= 0.004 = Weinig tot geen");
 		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/z2 = 0.008 = Standaart");
  		SendClientMessage(playerid, COLOR_MGREEN, "[INFO] {FFFFFF}/z1(+) = 0.012 = Meer");
		return 1;
	}
	if (strcmp("/rules", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[REGELS]{FFFFFF} 1) Regels:");
		SendClientMessage(playerid, COLOR_MGREEN, "[REGELS]{FFFFFF} 2) Spawnkilling toegestaan.");
		SendClientMessage(playerid, COLOR_MGREEN, "[REGELS]{FFFFFF} 3) Cleo cheats/mods niet");
		SendClientMessage(playerid, COLOR_MGREEN, "[REGELS]{FFFFFF} 4) Meerdere acounts is niet teogestaan.");
		SendClientMessage(playerid, COLOR_MGREEN, "[REGELS]{FFFFFF} 5) Schelden, flooten, spammen en snele herhaling van teksten is ook niet toegestaan.");
		return 1;
	}
//----------------------------------------------------------
	if (strcmp("/kitinfo", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} Aantal kits beschikbaar: 6");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} /kit1: Baseball Bat, Silenced 9mm, Combat Shotgun, MP5");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} /kit2: Brass Knuckles, Katana, Molotov Cocktail, Micro SMG");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} /kit3: Knife, Silenced 9mm, Silenced 9mm, Combat Shotgun, MP5, M4, Sniper Rifle");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF}          Rocket Launcher, Satchel Charge, Detonator, Camera, Parachute");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} /kit4: empty!");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} /kit5: empty!");
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} /kit6: empty!");
		return 1;
	}
	if (strcmp("/kit", cmdtext, true, 5) == 0)
	{
		ShowPlayerDialog(playerid,510,DIALOG_STYLE_LIST,"Server Control:","Standaart kit [$10000]\nAsian Kit [$30000]\nHeavy Weapons Kit [$70000]\nKit4 [$10000]\nKit5 [$10000]\nKit6 [$10000]","Kies","Annuleren");
		return 1;
	}
	ShowPlayerDialog(playerid,500,DIALOG_STYLE_LIST,"Server Control:","Tijd\nWeer\nZwaartekracht\nSkins\nGeld\nSpeler Marker\nServer Herstarten\nSever Afsluiten","Kies","Annuleren");
	if (strcmp("/kit1", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[KIT1]{FFFFFF} Standaart kit:");
		SendClientMessage(playerid, COLOR_MGREEN, "[KIT1]{FFFFFF} Baseball Bat, Silenced 9mm, Combat Shotgun, MP5");
        GivePlayerWeapon(playerid, 0, 1);
        GivePlayerWeapon(playerid, 5, 1);
        GivePlayerWeapon(playerid, 23, 1000);
        GivePlayerWeapon(playerid, 27, 1000);
        GivePlayerWeapon(playerid, 29, 1000);
		return 1;
	}
	if (strcmp("/kit2", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[KIT2]{FFFFFF} Asian kit:");
		SendClientMessage(playerid, COLOR_MGREEN, "[KIT2]{FFFFFF} Brass Knuckles, Katana, Molotov Cocktail, Micro SMG");
        GivePlayerWeapon(playerid, 1, 1);
        GivePlayerWeapon(playerid, 8, 1);
        GivePlayerWeapon(playerid, 18, 1000);
        GivePlayerWeapon(playerid, 28, 1000);
		return 1;
	}
	if (strcmp("/kit3", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[KIT3]{FFFFFF} Heavy Weapons kit:");
		SendClientMessage(playerid, COLOR_MGREEN, "[KIT3]{FFFFFF} Knife, Silenced 9mm, Silenced 9mm, Combat Shotgun, MP5, M4, Sniper Rifle,");
		SendClientMessage(playerid, COLOR_MGREEN, "[KIT3]{FFFFFF} Rocket Launcher, Satchel Charge, Detonator, Camera, Parachute");
        GivePlayerWeapon(playerid, 0, 1);
        GivePlayerWeapon(playerid, 4, 1);
        GivePlayerWeapon(playerid, 23, 1000);
        GivePlayerWeapon(playerid, 27, 1000);
        GivePlayerWeapon(playerid, 29, 1000);
        GivePlayerWeapon(playerid, 31, 1000);
        GivePlayerWeapon(playerid, 34, 1000);
        GivePlayerWeapon(playerid, 35, 1000);
        GivePlayerWeapon(playerid, 39, 1000);
        GivePlayerWeapon(playerid, 40, 1000);
        GivePlayerWeapon(playerid, 43, 1000);
        GivePlayerWeapon(playerid, 46, 1000);

		return 1;
	}
	if (strcmp("/kit4", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[KIT]{FFFFFF} empty!");
		return 1;
	}
	if (strcmp("/kit5", cmdtext, true, 5) == 0)
	{
		SetPlayerHealth(playerid, 100);
		SendClientMessage(playerid, COLOR_MGREEN, "[KIT]{FFFFFF} empty!");
		return 1;
	}
	if (strcmp("/kit6", cmdtext, true, 5) == 0)
	{
		SendClientMessage(playerid, COLOR_MGREEN, "[KIT]{FFFFFF} empty!");

		return 1;
	}
//----------------------------------------------------------
	if (strcmp("/h", cmdtext, true, 5) == 0)
	{
		SetPlayerHealth(playerid, 100);
 	    GivePlayerMoney(playerid, -15000);
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} Je bent gehealt.");
 	    GivePlayerMoney(playerid, -1000);
		return 1;
	}
	if (strcmp("/a", cmdtext, true, 5) == 0)
		{
		SetPlayerArmour(playerid, 1000);
 	    GivePlayerMoney(playerid, -10000);
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} Je hebt amour gekregen.");
		return 1;
	}
	if (strcmp("/p", cmdtext, true, 5) == 0)
		{
        GivePlayerWeapon(playerid, 46, 1);
 	    GivePlayerMoney(playerid, -1000);
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} Je hebt parachute gekregen.");
		return 1;
	}
	if (strcmp("/kill", cmdtext, true, 5) == 0)
	{
		SetPlayerHealth(playerid, 0);
 		SetPlayerArmour(playerid, 0);
   	    GivePlayerMoney(playerid, -100);
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} Je hebt jezelf gedoodt.");
		return 1;
	}
	if (strcmp("/+money", cmdtext, true, 5) == 0)
	{
   	    GivePlayerMoney(playerid, 100000);
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} +$100000");
		return 1;
	}
	if (strcmp("/-money", cmdtext, true, 5) == 0)
	{
   	    GivePlayerMoney(playerid, -100000);
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} -$100000");
		return 1;
	}
//----------------------------------------------------------
    if(strcmp(cmdtext, "/s1", true) == 0)
    {
        SetPlayerSkin(playerid, 163);
        return 1;
    }
    if(strcmp(cmdtext, "/s2", true) == 0)
    {
        SetPlayerSkin(playerid, 166);
        return 1;
    }
    if(strcmp(cmdtext, "/s3", true) == 0)
    {
        SetPlayerSkin(playerid, 164);
        return 1;
    }
    if(strcmp(cmdtext, "/s4", true) == 0)
    {
        SetPlayerSkin(playerid, 165);
        return 1;
    }
    if(strcmp(cmdtext, "/s5", true) == 0)
    {
        SetPlayerSkin(playerid, 227);
        return 1;
    }
    if(strcmp(cmdtext, "/s6", true) == 0)
    {
        SetPlayerSkin(playerid, 255);
        return 1;
    }
    if(strcmp(cmdtext, "/s7", true) == 0)
    {
        SetPlayerSkin(playerid, 228);
        return 1;
    }
    if(strcmp(cmdtext, "/s8", true) == 0)
    {
        SetPlayerSkin(playerid, 17);
        return 1;
    }
    if(strcmp(cmdtext, "/s9", true) == 0)
    {
        SetPlayerSkin(playerid, 57);
        return 1;
    }
    if(strcmp(cmdtext, "/s10", true) == 0)
    {
        SetPlayerSkin(playerid, 252);
        return 1;
    }
//----------------------------------------------------------
    if(strcmp(cmdtext, "/w1", true) == 0)
    {
        SetPlayerWeather(playerid, 08);
        SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Storm");
        return 1;
    }
    if(strcmp(cmdtext, "/w2", true) == 0)
    {
        SetPlayerWeather(playerid, 09);
        SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Mistig");
        return 1;
    }
    if(strcmp(cmdtext, "/w3", true) == 0)
    {
        SetPlayerWeather(playerid, 11);
        SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Heet (Warmte Golven)");
        return 1;
    }
    if(strcmp(cmdtext, "/w4", true) == 0)
    {
        SetPlayerWeather(playerid, 19);
        SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Zandstorm");
        return 1;
    }
    if(strcmp(cmdtext, "/w5", true) == 0)
    {
        SetPlayerWeather(playerid, 15);
        SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Grijsachtig");
        return 1;
    }
    if(strcmp(cmdtext, "/w6", true) == 0)
    {
        SetPlayerWeather(playerid, 16);
        SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Regen");
        return 1;
    }
//----------------------------------------------------------
    if(strcmp(cmdtext, "/ochtent", true) == 0)
    {
        SetWorldTime(6);
        SendClientMessageToAll(COLOR_MBLUE, "[TIJD]{FFFFFF} Ochtend (06:00)");
        return 1;
    }
    if(strcmp(cmdtext, "/middag", true) == 0)
    {
        SetWorldTime(12);
        SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Middag (12:00)");
        return 1;
    }
    if(strcmp(cmdtext, "/nacht", true) == 0)
    {
        SetWorldTime(23);
        SendClientMessageToAll(COLOR_MBLUE, "[TIJD]{FFFFFF} Nacht (23:00)");
        return 1;
    }
//----------------------------------------------------------
    if(strcmp(cmdtext, "/z1", true) == 0)
    {
        SetGravity(0.004);
        SendClientMessageToAll(COLOR_MBLUE, "[ZK]{FFFFFF} Zwaartekrach: 0.004");
        return 1;
    }
    if(strcmp(cmdtext, "/z1+", true) == 0)
    {
        SetGravity(-0.00);
        SendClientMessageToAll(COLOR_MBLUE, "[ZK]{FFFFFF} Zwaartekrach: -0.00");
        return 1;
    }
    if(strcmp(cmdtext, "/z1++", true) == 0)
    {
        SetGravity(-0.004);
        SendClientMessageToAll(COLOR_MBLUE, "[ZK]{FFFFFF} Zwaartekrach: -0.004");
        return 1;
    }
    if(strcmp(cmdtext, "/z2", true) == 0)
    {
        SetGravity(0.008);
        SendClientMessageToAll(COLOR_MBLUE, "[ZK]{FFFFFF} Zwaartekrach: 0.008");
        return 1;
    }
    if(strcmp(cmdtext, "/z3", true) == 0)
    {
        SetGravity(0.012);
        SendClientMessageToAll(COLOR_MBLUE, "[ZK]{FFFFFF} Zwaartekrach: 0.012");
        return 1;
    }
    if(strcmp(cmdtext, "/z3+", true) == 0)
    {
        SetGravity(0.020);
        SendClientMessageToAll(COLOR_MBLUE, "[ZK]{FFFFFF} Zwaartekrach: 0.020");
        return 1;
    }
    if(strcmp(cmdtext, "/z3++", true) == 0)
    {
        SetGravity(0.035);
        SendClientMessageToAll(COLOR_MBLUE, "[ZK]{FFFFFF} Zwaartekrach: 0.035");
        return 1;
    }
    if(!strcmp(cmdtext, "/npcmenu", true))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "NPC's Online:", "Aantal NPC's online: 19", "Oke", "Sluiten");
        return 1;
    }
    if (!strcmp("/r", cmdtext))
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "Je bent niet in een voertuig.");
        RepairVehicle(GetPlayerVehicleID(playerid));
   	    GivePlayerMoney(playerid, -10000);
        SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} Voertuig gerepareert.");
        return 1;
    }
    if (!strcmp("/countdown", cmdtext))
    {
        SendClientMessageToAll(COLOR_MBLUE, "[INFO]{FFFFFF} Aftellen gestart (5 seconde)");
        SetTimer("b1", 1000, false);
        SetTimer("b2", 2000, false);
        SetTimer("b3", 3000, false);
        SetTimer("b4", 4000, false);
        SetTimer("b5", 5000, false);
        SetTimer("b6", 6000, false);
        SetTimer("b7", 6000, false);
        return 1;
    }
	if (strcmp("/s", cmdtext, true, 10) == 0)
    {
        new File:file,str[256];
        file=fopen("save1.txt",io_append);
		SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} Positie opgeslagen");
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        format(str, 256,"%.3f,%.3f,%.3f",x,y,z);
        fwrite(file,str);
        fwrite(file,"\r\n");
        fclose(file);
        return 1;
    }
    if (strcmp("/ontzichtbaar", cmdtext, true) == 0)
	{
    	for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
 		new string[64], playerName[MAX_PLAYER_NAME];
    	GetPlayerName(playerid,playerName,MAX_PLAYER_NAME);
    	format(string,sizeof string,"[INFO] {FFFFFF}%s heeft zichzelf ontzichtbaar gemaakt",playerName);
    	SendClientMessageToAll(COLOR_MGREEN,string);
    	ShowNameTags( 0 );
    	return 1;
	}
 	if (strcmp("/zichtbaar", cmdtext, true) == 0)
	{
    	for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, true);
 		new string[64], playerName[MAX_PLAYER_NAME];
    	GetPlayerName(playerid,playerName,MAX_PLAYER_NAME);
    	format(string,sizeof string,"[INFO] {FFFFFF}%s heeft zichzelf zichtbaar gemaakt",playerName);
    	SendClientMessageToAll(COLOR_MGREEN,string);
    	ShowNameTags( 1 );
    	return 1;
	}
	if(strcmp(cmdtext,"/sc",true)==0)
	{
	    ShowPlayerDialog(playerid,500,DIALOG_STYLE_LIST,"Server Control:","Tijd\nWeer\nZwaartekracht\nSkins\nGeld\nSpeler Marker\nServer Herstarten\nSever Afsluiten","Kies","Annuleren");
	    return 1;
	}
	return 0;
}
Reply
#6

Quote:
Originally Posted by SlashQ
Посмотреть сообщение
Oh

Do you have any other /r commands in your script (or, beginning with r)? I think it's something to do with the length parameter in strcmp.
Do you now how to fix it?
Sorry for double post
Reply
#7

I'm not sure I understand, does every command open the dialog?
Reply
#8

Quote:
Originally Posted by .:Kaos:.
Посмотреть сообщение
I'm not sure I understand, does every command open the dialog?
yes, every command
Reply
#9

Show us your OnDialogResponse
Reply
#10

Here
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
	{
	if(dialogid==500 && response==1)
		{
		switch(listitem)
		{
			case 0:
			{
				ShowPlayerDialog(playerid,501,DIALOG_STYLE_LIST,"Tijd:","00:00\n03:00\n06:00\n09:00\n12:00\n15:00\n18:00\n21:00","Kies","Annuleren");
			}
			case 1:
			{
				ShowPlayerDialog(playerid,502,DIALOG_STYLE_LIST,"Weer:","Storm\nMistig\nheet\nZandstorm\nGrijsachtig\nRegen","Kies","Annuleren");
			}
			case 2:
			{
				ShowPlayerDialog(playerid,503,DIALOG_STYLE_LIST,"Zwaartekracht:","-0.004\n0.000\n0.004\n0.008 (Standaart)\n0.012\n0.016\n0.018\n0.032","Kies","Annuleren");
			}
			case 3:
			{
				ShowPlayerDialog(playerid,504,DIALOG_STYLE_LIST,"Skin:","Skin 1\nSkin 2\nSkin 3\nSkin 4\nSkin 5\nSkin 6\nSkin 7\nSkin 8\nSkin 9\nSkin 10","Kies","Annuleren");
			}
			case 4:
			{
				ShowPlayerDialog(playerid,505,DIALOG_STYLE_LIST,"Geld:","$100\n$1000\n$10000\n$100000\n$1000000\n$10000000","Kies","Annuleren");
			}
			case 5:
			{
				ShowPlayerDialog(playerid,506,DIALOG_STYLE_LIST,"Marker:","Uit\nGlobal\nStreamed","Kies","Annuleren");
			}
			case 6:
			{
				ShowPlayerDialog(playerid,507,DIALOG_STYLE_MSGBOX,"Server Herstarten","Weet je zeker dat je de server wilt herstarten?","Ja","Nee");
			}
			case 7:
			{
				ShowPlayerDialog(playerid,508,DIALOG_STYLE_MSGBOX,"Server Afsluiten","Weet je zeker dat je de server wilt afsluiten?","Ja","Nee");
			}
		}
	}
	if(dialogid==501 && response==1)
		{
		switch(listitem)
		{
			case 0:
			{
				SetWorldTime(0);
				SendClientMessageToAll(COLOR_MBLUE, "[TIJD]{FFFFFF} De tijd is verzet naar 00:00");
			}
			case 1:
			{
				SetWorldTime(3);
				SendClientMessageToAll(COLOR_MBLUE, "[TIJD]{FFFFFF} De tijd is verzet naar 03:00");
			}
			case 2:
			{
				SetWorldTime(6);
				SendClientMessageToAll(COLOR_MBLUE, "[TIJD]{FFFFFF} De tijd is verzet naar 06:00");
			}
			case 3:
			{
				SetWorldTime(9);
				SendClientMessageToAll(COLOR_MBLUE, "[TIJD]{FFFFFF} De tijd is verzet naar 09:00");
			}
			case 4:
			{
				SetWorldTime(12);
				SendClientMessageToAll(COLOR_MBLUE, "[TIJD]{FFFFFF} De tijd is verzet naar 12:00");
			}
			case 5:
			{
				SetWorldTime(15);
				SendClientMessageToAll(COLOR_MBLUE, "[TIJD]{FFFFFF} De tijd is verzet naar 15:00");
			}
			case 6:
			{
				SetWorldTime(18);
				SendClientMessageToAll(COLOR_MBLUE, "[TIJD]{FFFFFF} De tijd is verzet naar 18:00");
			}
			case 7:
			{
				SetWorldTime(21);
				SendClientMessageToAll(COLOR_MBLUE, "[TIJD]{FFFFFF} De tijd is verzet naar 21:00");
			}
		}
	}
	if(dialogid==502 && response==1)
		{
		switch(listitem)
		{
			case 0:
			{
				SetPlayerWeather(playerid, 8);
				SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Storm");
			}
			case 1:
			{
				SetPlayerWeather(playerid, 9);
				SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Mistig");
			}
			case 2:
			{
				SetPlayerWeather(playerid, 11);
				SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Heet (Warmte Golven)");
			}
			case 3:
			{
				SetPlayerWeather(playerid, 19);
				SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Zandstorm");
			}
			case 4:
			{
				SetPlayerWeather(playerid, 15);
				SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Grijsachtig");
			}
			case 5:
			{
				SetPlayerWeather(playerid, 16);
				SendClientMessageToAll(COLOR_MBLUE, "[WEER]{FFFFFF} Regen");
			}
		}
	}
	if(dialogid==503 && response==1)
		{
		switch(listitem)
		{
			case 0:
			{
				SetGravity(-0.004);
				SendClientMessageToAll(COLOR_MBLUE, "[Zwaartekracht]{FFFFFF} Zwaartekrach: -0.004");
			}
			case 1:
			{
				SetGravity(0.00);
				SendClientMessageToAll(COLOR_MBLUE, "[Zwaartekracht]{FFFFFF} Zwaartekrach: 0.00");
			}
			case 2:
			{
				SetGravity(0.004);
				SendClientMessageToAll(COLOR_MBLUE, "[Zwaartekracht]{FFFFFF} Zwaartekrach: 0.004");
			}
			case 3:
			{
				SetGravity(0.008);
				SendClientMessageToAll(COLOR_MBLUE, "[Zwaartekracht]{FFFFFF} Zwaartekrach: 0.008");
			}
			case 4:
			{
				SetGravity(0.012);
				SendClientMessageToAll(COLOR_MBLUE, "[Zwaartekracht]{FFFFFF} Zwaartekrach: 0.012");
			}
			case 5:
			{
				SetGravity(0.016);
				SendClientMessageToAll(COLOR_MBLUE, "[Zwaartekracht]{FFFFFF} Zwaartekrach: 0.016");
			}
			case 6:
			{
				SetGravity(0.032);
				SendClientMessageToAll(COLOR_MBLUE, "[Zwaartekracht]{FFFFFF} Zwaartekrach: 0.032");
			}
		}
	}
	if(dialogid==504 && response==1)
		{
		switch(listitem)
		{
			case 0:
			{
				SetPlayerSkin(playerid, 163);
				return 1;
			}
			case 1:
			{
				SetPlayerSkin(playerid, 166);
				return 1;
			}
			case 2:
			{
				SetPlayerSkin(playerid, 164);
				return 1;
			}
			case 3:
			{
				SetPlayerSkin(playerid, 165);
				return 1;
			}
			case 4:
			{
				SetPlayerSkin(playerid, 227);
				return 1;
			}
			case 5:
			{
				SetPlayerSkin(playerid, 255);
				return 1;
			}
			case 6:
			{
				SetPlayerSkin(playerid, 228);
				return 1;
			}
			case 7:
			{
				SetPlayerSkin(playerid, 17);
				return 1;
			}
			case 8:
			{
				SetPlayerSkin(playerid, 57);
				return 1;
			}
			case 9:
			{
				SetPlayerSkin(playerid, 252);
				return 1;
			}
		}
	}
	if(dialogid==505 && response==1)
		{
		switch(listitem)
		{
			case 0:
			{
				GivePlayerMoney(playerid, 100);
				SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} +$100");
				return 1;
			}
			case 1:
			{
				GivePlayerMoney(playerid, 1000);
				SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} +$1000");
				return 1;
			}
			case 2:
			{
				GivePlayerMoney(playerid, 10000);
				SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} +$10000");
				return 1;
			}
			case 3:
			{
				GivePlayerMoney(playerid, 100000);
				SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} +$100000");
				return 1;
			}
			case 4:
			{
				GivePlayerMoney(playerid, 1000000);
				SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} +$1000000");
				return 1;
			}
			case 5:
			{
				GivePlayerMoney(playerid, 10000000);
				SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} +$10000000");
				return 1;
			}
		}
	}
	if(dialogid==506 && response==1)
		{
		switch(listitem)
		{
			case 0:
			{
				ShowPlayerMarkers(0);
				SendClientMessageToAll(COLOR_RED,"[MARKER]: Uit");
				return 1;
			}
			case 1:
			{
				ShowPlayerMarkers(1);
				SendClientMessageToAll(COLOR_RED,"[MARKER]: Globaal");
				return 1;
			}
			case 2:
			{
				ShowPlayerMarkers(2);
				SendClientMessageToAll(COLOR_RED,"[MARKER]: Streamed");
				return 1;
			}
		}
	}
	if(dialogid==507 && response==1)
		{
		SendRconCommand("gmx");
		SendClientMessageToAll(COLOR_RED,"[SERVER]: Herstarten...");
		return 1;
	}
	if(dialogid==508 && response==1)
		{
		SendRconCommand("exit");
		SendClientMessageToAll(COLOR_RED,"[SERVER]: Afsluiten...");
		return 1;
	}
	if(dialogid==510 && response==1)
		{
		switch(listitem)
		{
			case 0:
			{
				SendClientMessage(playerid, COLOR_MGREEN, "[KIT]{FFFFFF} Standaart kit:");
				SendClientMessage(playerid, COLOR_MGREEN, "[KIT]{FFFFFF} Baseball Bat, Silenced 9mm, Combat Shotgun, MP5");
				GivePlayerWeapon(playerid, 0, 1);
				GivePlayerWeapon(playerid, 5, 1);
				GivePlayerWeapon(playerid, 23, 1000);
				GivePlayerWeapon(playerid, 27, 1000);
				GivePlayerWeapon(playerid, 29, 1000);
				GivePlayerMoney(playerid, -10000);
				return 1;
			}
			case 1:
			{
				SendClientMessage(playerid, COLOR_MGREEN, "[KIT]{FFFFFF} Asian kit:");
				SendClientMessage(playerid, COLOR_MGREEN, "[KIT]{FFFFFF} Brass Knuckles, Katana, Molotov Cocktail, Micro SMG");
				GivePlayerWeapon(playerid, 1, 1);
				GivePlayerWeapon(playerid, 8, 1);
				GivePlayerWeapon(playerid, 18, 1000);
				GivePlayerWeapon(playerid, 28, 1000);
				GivePlayerMoney(playerid, -30000);
				return 1;
			}
			case 2:
			{
				SendClientMessage(playerid, COLOR_MGREEN, "[KIT]{FFFFFF} Heavy Weapons kit:");
				SendClientMessage(playerid, COLOR_MGREEN, "[KIT]{FFFFFF} Knife, Silenced 9mm, Silenced 9mm, Combat Shotgun, MP5, M4, Sniper Rifle,");
				SendClientMessage(playerid, COLOR_MGREEN, "[KIT]{FFFFFF} Rocket Launcher, Satchel Charge, Detonator, Camera, Parachute");
				GivePlayerWeapon(playerid, 0, 1);
				GivePlayerWeapon(playerid, 4, 1);
				GivePlayerWeapon(playerid, 23, 1000);
				GivePlayerWeapon(playerid, 27, 1000);
				GivePlayerWeapon(playerid, 29, 1000);
				GivePlayerWeapon(playerid, 31, 1000);
				GivePlayerWeapon(playerid, 34, 1000);
				GivePlayerWeapon(playerid, 35, 1000);
				GivePlayerWeapon(playerid, 39, 1000);
				GivePlayerWeapon(playerid, 40, 1000);
				GivePlayerWeapon(playerid, 43, 1000);
				GivePlayerWeapon(playerid, 46, 1000);
				GivePlayerMoney(playerid, -70000);
				return 1;
			}
			case 3:
			{
				GivePlayerMoney(playerid, 100000);
				SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} +$100000");
				return 1;
			}
			case 4:
			{
				GivePlayerMoney(playerid, 1000000);
				SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} +$1000000");
				return 1;
			}
			case 5:
			{
				GivePlayerMoney(playerid, 10000000);
				SendClientMessage(playerid, COLOR_MGREEN, "[INFO]{FFFFFF} +$10000000");
				return 1;
			}
		}
	}
	return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)