Little Help Needed with (/fps [id]) Command -
Airman123 - 09.02.2015
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
Re: Little Help Needed with (/fps [id]) Command -
Airman123 - 09.02.2015
anyonE?
Re: Little Help Needed with (/fps [id]) Command -
CalvinC - 09.02.2015
You're declaring "targetid" as "playerid", which brings no use to it.
Replace this:
By this:
Re: Little Help Needed with (/fps [id]) Command -
Airman123 - 09.02.2015
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,
Re: Little Help Needed with (/fps [id]) Command -
CalvinC - 09.02.2015
Show your "pFPS" then.
Re: Little Help Needed with (/fps [id]) Command -
JeaSon - 09.02.2015
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;
}
Re: Little Help Needed with (/fps [id]) Command -
Schneider - 09.02.2015
@Namer: That code is wrong. You want to get the name of targetid, not playerid.
Re: Little Help Needed with (/fps [id]) Command -
JeaSon - 09.02.2015
sorry my bad didnt saw that ( fixed it )
Re: Little Help Needed with (/fps [id]) Command -
Airman123 - 13.02.2015
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?
Re: Little Help Needed with (/fps [id]) Command -
Airman123 - 13.02.2015
any halp? :S