warning 202: number of arguments does not match definition ./includes/functions.pwn(21321) : warning 202: number of arguments does not match definition
format(string, sizeof(string), "Spectating %s(%d): HP: %d Armour: %d", GetPlayerNameEx(Spectate[playerid]), Spectate[playerid], GetPlayerHealth(playerid), GetPlayerArmour(playerid));
forward SpecUpdate(playerid); public SpecUpdate(playerid) { if(Spectating[playerid] > 0 && Spectate[playerid] != INVALID_PLAYER_ID) { for(new i = 0; i < 2; i++) { TogglePlayerSpectating(playerid, true); PlayerSpectatePlayer( playerid, Spectate[playerid] ); SetPlayerInterior( playerid, GetPlayerInterior( Spectate[playerid] ) ); SetPlayerVirtualWorld( playerid, GetPlayerVirtualWorld( Spectate[playerid] ) ); new string[128]; format(string, sizeof(string), "Spectating %s(%d): HP: %d Armour: %d", GetPlayerNameEx(Spectate[playerid]), Spectate[playerid], GetPlayerHealth(playerid), GetPlayerArmour(playerid)); GameTextForPlayer(playerid, string, 5000, 2); } } return 1; }
forward SpecUpdate(playerid);
public SpecUpdate(playerid)
{
if(Spectating[playerid] > 0 && Spectate[playerid] != INVALID_PLAYER_ID) {
for(new i = 0; i < 2; i++) {
TogglePlayerSpectating(playerid, true);
PlayerSpectatePlayer( playerid, Spectate[playerid] );
SetPlayerInterior( playerid, GetPlayerInterior( Spectate[playerid] ) );
SetPlayerVirtualWorld( playerid, GetPlayerVirtualWorld( Spectate[playerid] ) );
new string[128], Float:zhp, Float:zarmour;
GetPlayerHealth(playerid, zhp);
GetPlayerArmour(playerid, zarmour);
format(string, sizeof(string), "Spectating %s(%d): HP: %f Armour: %f", GetPlayerNameEx(Spectate[playerid]), Spectate[playerid], zhp, zarmour);
GameTextForPlayer(playerid, string, 5000, 2);
}
}
return 1;
}
Functions GetPlayerHealth and GetPlayerArmour stores the value in a variable.
https://sampwiki.blast.hk/wiki/GetPlayerHealth https://sampwiki.blast.hk/wiki/GetPlayerArmour So you must do something like: pawn Код:
|