Is this possible?
#1

1) Enter command in the player's name? (More precisely - /fpslimit )
2) Set setting(fps limit) to all players on connect?

Or is there any function which will set player's FPS limit?
Reply
#2

I don't guess so, since it's a client CMD.
Reply
#3

Set? probably not, there are some functions laying around that get a player's fps tho.
Reply
#4

You could use this if you're trying to send the command for individual players
Код:
COMMAND:fakecommand(playerid,params[])
{
   		new TargetID, command[64];
		
	    if(sscanf(params, "us[64]", TargetID, command))
        {
        SendClientMessage(playerid, COLOR_ERROR, "Usage: /fakecommand [PlayerID] [Command]") &&
		SendClientMessage(playerid, COLOR_ERROR, "Function: Will send a false Command used per Specified player");
		return 1;
		}
		
        if(IsPlayerConnected(TargetID) && TargetID != INVALID_PLAYER_ID)
		{
	         CallRemoteFunction("OnPlayerCommandText", "us", TargetID, command); 
	    }
		else SendClientMessage(playerid,COLOR_ERROR,"That Player is Not Connected");
	return 1;
}
Reply
#5

Quote:
Originally Posted by Ducati
Посмотреть сообщение
You could use this if you're trying to send the command for individual players
Код:
COMMAND:fakecommand(playerid,params[])
{
   		new TargetID, command[64];
		
	    if(sscanf(params, "us[64]", TargetID, command))
        {
        SendClientMessage(playerid, COLOR_ERROR, "Usage: /fakecommand [PlayerID] [Command]") &&
		SendClientMessage(playerid, COLOR_ERROR, "Function: Will send a false Command used per Specified player");
		return 1;
		}
		
        if(IsPlayerConnected(TargetID) && TargetID != INVALID_PLAYER_ID)
		{
	         CallRemoteFunction("OnPlayerCommandText", "us", TargetID, command); 
	    }
		else SendClientMessage(playerid,COLOR_ERROR,"That Player is Not Connected");
	return 1;
}
You can't enforce client-sided cmds...
Reply
#6

Quote:
Originally Posted by Ducati
Посмотреть сообщение
You could use this if you're trying to send the command for individual players
Код:
COMMAND:fakecommand(playerid,params[])
{
   		new TargetID, command[64];
		
	    if(sscanf(params, "us[64]", TargetID, command))
        {
        SendClientMessage(playerid, COLOR_ERROR, "Usage: /fakecommand [PlayerID] [Command]") &&
		SendClientMessage(playerid, COLOR_ERROR, "Function: Will send a false Command used per Specified player");
		return 1;
		}
		
        if(IsPlayerConnected(TargetID) && TargetID != INVALID_PLAYER_ID)
		{
	         CallRemoteFunction("OnPlayerCommandText", "us", TargetID, command); 
	    }
		else SendClientMessage(playerid,COLOR_ERROR,"That Player is Not Connected");
	return 1;
}
Touching on this, what this actually does is directly call OnPlayerCommandText. This is then handled by the script accordingly from there, either inline or forwarded to something such as zmcd. Natively, SA-MP does not (for good reason) allow interaction with client side commands and nothing is sent to the server when you type them (bar /quit). You can check for FPS and enforce players using a certain /fpslimit or face kick/freeze, but can't force it on them.

For checking FPS, see this. Is there a specific reason you wish to limit it?
Reply
#7

There is a lot of players who use that fps limit for "speed". I want to increase FPS limit to all players, so they can't abuse that.

Thank you a lot, i will try with that GetPlayerFPS!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)