Little Help Needed with (/fps [id]) Command
#1

Hello, I need help with this command.

Код:
COMMAND:fps(playerid,params[])
{
	    new targetid=playerid;
	    sscanf(params,"u",targetid);
            if(!IsPlayerConnected(targetid))
            return SendClientMessage(playerid, ADMIN_RED, "That Player is not Connected!");
	    FpsShow(playerid,targetid);
   	    return 1;
}
stock FpsShow(playerid, targetid)
{
        new string[256];
	new TargetName[MAX_PLAYER_NAME];
	GetPlayerName(targetid,TargetName,sizeof(TargetName));


	format(string, sizeof(string), "%s's (%d) Current Fps is: %d.", PlayerName(targetid), targetid, pFPS);
        SendClientMessage(playerid, LIGHTGREEN, string);
	return 1;
}
My problem is that, this command doesn't shows the fps of target player, it only shows fps of "playerid"

How do i make "pFps" for TargetID. Help me
Reply
#2

anyonE?
Reply
#3

You're declaring "targetid" as "playerid", which brings no use to it.
Replace this:
pawn Код:
new targetid=playerid;
By this:
pawn Код:
new targetid;
Reply
#4

this is not problem, problem is how can i see player's fps by typing his id.

it shows target's id targetname and ID but shows fps of playerid,
Reply
#5

Show your "pFPS" then.
Reply
#6

pawn Код:
COMMAND:fps(playerid,params[])
{
        new targetid;
            new string[256];
        if(sscanf(params,"u",targetid)) return SendClientMessage(playerid, LIGHTGREEN, "Usage:/fps <ID>");
            if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, ADMIN_RED, "That Player is not  Connected!");
        format(string, sizeof(string), "%s's (%d) Current Fps is: %d.", PlayerName(targetid), targetid, pFPS);
        SendClientMessage(playerid, LIGHTGREEN, string);
        return 1;
}
Reply
#7

@Namer: That code is wrong. You want to get the name of targetid, not playerid.
Reply
#8

sorry my bad didnt saw that ( fixed it )
Reply
#9

No!! i dont want anything else then how to get the target player fps?
im using following pFPS code.
Код:
public OnPlayerUpdate(playerid)
{
    new drunknew;
    drunknew = GetPlayerDrunkLevel(playerid);

    if (drunknew < 100) { // go back up, keep cycling.
    SetPlayerDrunkLevel(playerid, 2000);
    }else{
    if (pDrunkLevelLast[playerid] != drunknew)
	{
    new wfps = pDrunkLevelLast[playerid] - drunknew;

    if ((wfps > 0) && (wfps < 200))
    pFPS[playerid] = wfps;
    pDrunkLevelLast[playerid] = drunknew;
    }

    }
return 1;
Any one help? how can i use this to get TargetID Fps?
Reply
#10

any halp? :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)