help onplayercommandtext
#1

hi, can u help me i dont know cause of this problem


Код:
C:\Users\Agus Purwantoro\Desktop\SAMP\gamemodes\gm(325) : error 017: undefined symbol "text"

Код:
if(strcmp(cmdtext, "/ad", true) == 0 || strcmp(cmdtext, "/advertise", true) == 0)
		{
		    new string[128], name[64] ;
      		GetPlayerName(playerid, name, sizeof(name));
		    if(sscanf(cmdtext, "s[128]", cmdtext)) return SendClientMessage(playerid, COLOR_GRAY, "{F300FF}***AdmCmd   {0049FF}:   {FFFFFF}USAGE {0049FF}: {FFFFFF}/ad [text]");
		    if(ServerAdvert == 1)
		    {
		        SendClientMessage(playerid, COLOR_RED, "***Only one advertisement every 60 seconds!");
		    }
		    else
		    {
		        ServerAdvert = 1;
		        format(string, sizeof(string), "{F81414}[ SERVER ]   {0049FF}:   {FFFFFF}%s   {00C0FF}Contact {0049FF}: {FFFFFF}%s(%i)", cmdtext, text, name, playerid);
		        SendClientMessageToAll(COLOR_LIME, string);
		        SetTimer("AdTimer", 60000, false);
		        GivePlayerMoney(playerid, -10000);
		    }
		    return 1;
Reply
#2

kamu orang mana
Reply
#3

Код:
if(sscanf(cmdtext, "s[128]", cmdtext))
Change to
Код:
if(sscanf(params, "s[128]", name))
You didnt define cmdtext anywhere.I just added name so it wont give any error.Change it.
Reply
#4

jawa
Reply
#5

Код:
    if(strcmp(cmdtext, "/ad", true) == 0 || strcmp(cmdtext, "/advertise", true) == 0)
	{
		new string[128], name[64] ;
      	GetPlayerName(playerid, name, sizeof(name));
		if(sscanf(params, "s[128]", name)) return SendClientMessage(playerid, COLOR_GRAY, "{F300FF}***AdmCmd   {0049FF}:   {FFFFFF}USAGE {0049FF}: {FFFFFF}/ad [text]");
		if(ServerAdvert == 1)
		{
		    SendClientMessage(playerid, COLOR_RED, "***Only one advertisement every 60 seconds!");
		}
		else
		{
		    ServerAdvert = 1;
		    format(string, sizeof(string), "{F81414}[ SERVER ]   {0049FF}:   {FFFFFF}%s   {00C0FF}Contact {0049FF}: {FFFFFF}%s(%i)", cmdtext, text, name, playerid);
		    SendClientMessageToAll(COLOR_LIME, string);
		    SetTimer("AdTimer", 60000, false);
		    GivePlayerMoney(playerid, -10000);
		}
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)