SetArmourPlayer DEFINE - 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)
+--- Thread: SetArmourPlayer DEFINE (
/showthread.php?tid=489821)
SetArmourPlayer DEFINE -
Proxysteve - 24.01.2014
I would like that when a user leaves the server the user who has the armor on him not lost, use this script as filterscript to give armor users, but if you're entering the server lose the armor, please help me!
Код HTML:
#define FILTERSCRIPT
#include <a_samp>
#define COLOR_SLATEGRAY 0x708090FF
#define COLOR_LIMEGREEN 0x32CD32FF
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/setarmatura", cmdtext, false, 12) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "Non sei autorizzato a usare questo comando");
else if((cmdtext[12] != ' ') || (cmdtext[13] == ' ') || (cmdtext[13] == '\0'))
return SendClientMessage(playerid, 0xFF0000AA, "Usa: /setarmatura [playerid]");
new
targetid = strval(cmdtext[13]);
if(!IsPlayerConnected(targetid))
return SendClientMessage(playerid, 0xFF0000AA, "PlayerID non trovato");
SetPlayerArmour(targetid, 100.0);
SendClientMessage(playerid, COLOR_LIMEGREEN, "Armatura settata");
return 1;
}
return 0;
}
Re: SetArmourPlayer DEFINE -
gtaplayer1 - 24.01.2014
To do this you will need to save the player's armour in some form.
In OnPlayerSpawn you will load/set the player's armour.
In OnPlayerDisconnect you will save the player's armour.
There are a lot of systems that can save/load user data.
Here's a few:
dini
yini
Alternatively, you could use a
mysql plugin