SA-MP Forums Archive
Will this work? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Will this work? (/showthread.php?tid=170298)



Will this work? - RoCK'N'Rolla - 22.08.2010

hi,

I want to create a timer which will b for two players. But don't know if it will work. Here is:

pawn Код:
dcmd_spec(playerid, params[])
{
new ReturnPlayer;
if(sscanf(params, "d", ReturnPlayer)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cwspec [playerid]");
.
.
.
SetTimerEx("RefreshCWHealthArmour", 100, 1, "ii", playerid, ReturnPlayer);
return 1;
}

forward RefreshCWHealthArmour(playerid, specid);
public RefreshCWHealthArmour(playerid, specid)
{
    new Float:pHealth, Float:pArmour, string[256];
    GetPlayerHealth(specid, pHealth);
    GetPlayerArmour(specid, pArmour);
    format(string, sizeof(string), "%d/100", pHealth);
    TextDrawSetString(Textdraw13[playerid], string);
    format(string, sizeof(string), "%d/100", pArmour);
    TextDrawSetString(Textdraw14[playerid], string);
}
Here, i forwarded a public with "playerid" and as target player "specid". It might work?


Re: Will this work? - ZeRo_HUN - 22.08.2010

Yes, it's correct.


Re: Will this work? - RoCK'N'Rolla - 22.08.2010

Thank you.