help - 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: help (
/showthread.php?tid=248475)
help -
omer5198 - 14.04.2011
how can i check if there is something in file? like... "Armor=100"...
Re: help -
wheelman_WM - 14.04.2011
SetPlayerArmour(playerid, 100)
Find it
Re: help -
Cameltoe - 14.04.2011
Quote:
Originally Posted by wheelman_WM
SetPlayerArmour(playerid, 100)
Find it
|
That does set the players health.. it does not read an file to check what ever the int is stored as.
Give me an sec i'll give you an example how to check.
pawn Код:
stock GetPlayerIntFromFile(playerid, Info[])
{
new pFile[50]; format(pFile, sizeof(pFile), "./Accounts/%s.file", GetPlayerNameEx(playerid));
return dini_Int(pFile, Info);
}
stock GetPlayerNameEx(playerid)
{
new pName[25];
GetPlayerName(playerid, pName, sizeof(pName));
return pName;
}
Example:
pawn Код:
SetPlayerHealth(playerid, GetPlayerIntFromFile(playerid, "Health"));