SA-MP Forums Archive
just some help on this gm im making - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: just some help on this gm im making (/showthread.php?tid=200030)



just some help on this gm im making - yarrum3 - 17.12.2010

im trying to make my first gm and i type out my first command i want on it and i keep getting this error.
Код:
error 017: undefined symbol "cmd"



Re: just some help on this gm im making - CrucixTM - 17.12.2010

"cmd" is not defined with a "new"-define.


Re: just some help on this gm im making - yarrum3 - 17.12.2010

thought i try that but ok


Re: just some help on this gm im making - yarrum3 - 17.12.2010

Well i have change it into a wraning now.

Код:
warning 219: local variable "cmd" shadows a variable at a preceding level



Re: just some help on this gm im making - CrucixTM - 17.12.2010

Post the part with your code that doesn't work please.


Re: just some help on this gm im making - yarrum3 - 17.12.2010

here

Код:
new cmd[128];

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmd, "/info", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        {
				SendClientMessage(playerid, WHITE, " World Wide RolePlay");
		}
	}
	return 0;
}



Re: just some help on this gm im making - yarrum3 - 17.12.2010

i think one of my } what ever that thing is did not copy sorry.


Re: just some help on this gm im making - Baboon - 17.12.2010

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext,"/info",true))    //you forgot the !strcmp, and use boulean true.
	{
		SendClientMessage(playerid, WHITE, " World Wide RolePlay");
	}
	return 0;
}
}
Just do it this way, btw if you use isplayerconnected, you have to use a boulean too, but you are a beginner, so I would start with this.


Re: just some help on this gm im making - cessil - 17.12.2010

you might want to look into sscanf and zcmd if you're starting a new gm


Re: just some help on this gm im making - Baboon - 17.12.2010

dude, hes new, let him usa <a_samp>, start easily..