SA-MP Forums Archive
GMX command help - 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)
+--- Thread: GMX command help (/showthread.php?tid=442108)



GMX command help - aznpro12345 - 05.06.2013

this is a code I got from a filterscript and just wanted to add it to my script.. but keep getting these errors.

Код:
error 010: invalid function or declaration 
error 021: symbol already defined: "SendClientMessageEx"
error 010: invalid function or declaration
The GMX Command and Code
Код:
new
	RestartTime = 10,
	RestartTimer,
	str[512];

CMD:gmx(playerid)
{
	if(PlayerInfo[playerid][pAdmin] < 99997) {
    }
		RestartTimer = SetTimer("ServerRestartTime",1000,true);
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}

forward ServerRestartTime(playerid);
public ServerRestartTime(playerid)
{
	RestartTime--;
	if(RestartTime == 0)
	{
	    KillTimer(RestartTimer);
	    RestartTime = 10;
	    SendRconCommand("gmx");
	    return 1;
	}
	format(str,sizeof(str),"~g~Server Restart: ~r~%d",RestartTime);
	GameTextForAll(str,1150,3);
	return 1;
}
Please help me out, i'll rep


Re: GMX command help - eblood1 - 05.06.2013

Quote:
Originally Posted by aznpro12345
Посмотреть сообщение
this is a code I got from a filterscript and just wanted to add it to my script.. but keep getting these errors.

Код:
error 010: invalid function or declaration 
error 021: symbol already defined: "SendClientMessageEx"
error 010: invalid function or declaration
The GMX Command and Code
Код:
new
	RestartTime = 10,
	RestartTimer,
	str[512];

CMD:gmx(playerid)
{
	if(PlayerInfo[playerid][pAdmin] < 99997) {
    }
		RestartTimer = SetTimer("ServerRestartTime",1000,true);
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}

forward ServerRestartTime(playerid);
public ServerRestartTime(playerid)
{
	RestartTime--;
	if(RestartTime == 0)
	{
	    KillTimer(RestartTimer);
	    RestartTime = 10;
	    SendRconCommand("gmx");
	    return 1;
	}
	format(str,sizeof(str),"~g~Server Restart: ~r~%d",RestartTime);
	GameTextForAll(str,1150,3);
	return 1;
}
Please help me out, i'll rep
Change the name of your "SendClientMessageEx" function.


Re: GMX command help - SilverKiller - 05.06.2013

pawn Код:
new
    RestartTime = 10,
    RestartTimer,
    str[512];

CMD:gmx(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 99997)
    {
        RestartTimer = SetTimer("ServerRestartTime",1000,true);
    }
    else
    {
        SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}

forward ServerRestartTime(playerid);
public ServerRestartTime(playerid)
{
    RestartTime--;
    if(RestartTime == 0)
    {
        KillTimer(RestartTimer);
        RestartTime = 10;
        SendRconCommand("gmx");
        return 1;
    }
    format(str,sizeof(str),"~g~Server Restart: ~r~%d",RestartTime);
    GameTextForAll(str,1150,3);
    return 1;
}