Posts: 162
Threads: 61
Joined: Aug 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"
Posts: 293
Threads: 35
Joined: Jan 2010
Reputation:
0
"cmd" is not defined with a "new"-define.
Posts: 162
Threads: 61
Joined: Aug 2010
thought i try that but ok
Posts: 162
Threads: 61
Joined: Aug 2010
Well i have change it into a wraning now.
Код:
warning 219: local variable "cmd" shadows a variable at a preceding level
Posts: 293
Threads: 35
Joined: Jan 2010
Reputation:
0
Post the part with your code that doesn't work please.
Posts: 162
Threads: 61
Joined: Aug 2010
here
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/info", true) == 0)
{
if(IsPlayerConnected(playerid))
{
{
SendClientMessage(playerid, WHITE, " World Wide RolePlay");
}
}
return 0;
}
Posts: 162
Threads: 61
Joined: Aug 2010
i think one of my } what ever that thing is did not copy sorry.
Posts: 918
Threads: 125
Joined: Nov 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.
Posts: 1,363
Threads: 14
Joined: Apr 2009
Reputation:
0
you might want to look into sscanf and zcmd if you're starting a new gm
Posts: 918
Threads: 125
Joined: Nov 2010
dude, hes new, let him usa <a_samp>, start easily..