Something weird is happending
#1

Код:
if (strcmp("/pcar", cmdtext, true, 10) == 0)
	{
	        if (strcmp(pName,"[MG]Dimi", true))
		{
		    ShowPlayerDialog(playerid,Dimi_Car_Menu,DIALOG_STYLE_LIST, "{FFFF00}Private Car Selection", "{FFFFFF}SLOT 1:{0FFF00} Sultan \n{FFFFFF}SLOT 2:{FF0000} Empty Slot", "Spawn", "Cancel");
		}
                if (strcmp(pName,"[Air]Dule", true))
		{
		    ShowPlayerDialog(playerid,Dule_Car_Menu,DIALOG_STYLE_LIST, "{FFFF00}Private Car Selection", "{FFFFFF}SLOT 1:{0FFF00} Jester \n{FFFFFF}SLOT 2:{FF0000} Empty Slot", "Spawn", "Cancel");
		}
		if (strcmp(pName,"[Air]Beastboy", true))
		{
		    ShowPlayerDialog(playerid,Beastboy_Car_Menu,DIALOG_STYLE_LIST, "{FFFF00}Private Car Selection", "{FFFFFF}SLOT 1:{0FFF00} Turismo \n{FFFFFF}SLOT 2:{FF0000} Empty Slot", "Spawn", "Cancel");
		}
		if (strcmp(pName,"[Air]Proliner", true))
		{
		    ShowPlayerDialog(playerid,Proliner_Car_Menu,DIALOG_STYLE_LIST, "{FFFF00}Private Car Selection", "{FFFFFF}SLOT 1:{0FFF00} Elegy \n{FFFFFF}SLOT 2:{FF0000} Empty Slot", "Spawn", "Cancel");
		}
		if (strcmp(pName,"[Air]Zezima", true))
		{
		    ShowPlayerDialog(playerid,Zezima_Car_Menu,DIALOG_STYLE_LIST, "{FFFF00}Private Car Selection", "{FFFFFF}SLOT 1:{0FFF00} Buffalo \n{FFFFFF}SLOT 2:{FF0000} Empty Slot", "Spawn", "Cancel");
		}
		if (strcmp(pName,"[Air]Kevin", true))
		{
		    ShowPlayerDialog(playerid,Kevin_Car_Menu,DIALOG_STYLE_LIST, "{FFFF00}Private Car Selection", "{FFFFFF}SLOT 1:{0FFF00} Bullet \n{FFFFFF}SLOT 2:{FF0000} Empty Slot", "Spawn", "Cancel");
		}
		if (strcmp(pName,"[Air]Bogdan", true))
		{
		    ShowPlayerDialog(playerid,Bogdan_Car_Menu,DIALOG_STYLE_LIST, "{FFFF00}Private Car Selection", "{FFFFFF}SLOT 1:{0FFF00} Buffalo \n{FFFFFF}SLOT 2:{FF0000} Empty Slot", "Spawn", "Cancel");
		}
		else 
	    {
			SendClientMessage(playerid,0xFF0000FF,"ERROR: You don't own a private car");
			return 1;
		}
		return 1;
	}
Problem is in that when I do /pcar with nick [MG]Dimi I get message "ERROR: You don't own a private car" and when I enter the Server with nich "adaskjdbasda" I get random menu and spawned Sultan from First Menu. Anyone know how to fix it?

P.S. I have defined everything, add everything into Dialog Response etc. Only Problem is that the strcmp is doing opposite from thing it should do
Reply
#2

You're using strcmp incorrect. This is a great tutorial explaining how strcmp is actually used. Click here.
Reply
#3

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
P.S. I have defined everything, add everything into Dialog Response etc. Only Problem is that the strcmp is doing opposite from thing it should do
you're using it wrong

Код:
if(strcmp(...,...,true) == 0)
should work
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)