SA-MP Forums Archive
Help With Timer And Saving - 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: Help With Timer And Saving (/showthread.php?tid=485593)



Help With Timer And Saving - moustafa0550 - 04.01.2014

Help With Timer And Saving
i Want Can Bribe After 5min can take it again and i /createbribe its work only not save x y z i off server i make it again i want save x y z
Quote:

#define MAX_BRIBES 1

#include <a_samp>
#include <zcmd>

new BribeTimer[MAX_PLAYERS];
new Bribe[MAX_BRIBES];

CMD:createbribe(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not a RCON admin.");
new Float[3];
GetPlayerPos(playerid, p[0], p[1], p[2]);
for(new i = 0; i < MAX_BRIBES; i++)
{
Bribe[0] = CreatePickup(1247, 1, p[0], p[1], p[2], GetPlayerVirtualWorld(playerid));
}
SendClientMessage(playerid, -1, "You created a Bribe at your Location.");
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i = 0; i < MAX_BRIBES; i++)
{
if(pickupid == Bribe[i])
{
new Wanted = GetPlayerWantedLevel(playerid);
if(Wanted == 0) return SendClientMessage(playerid, -1, "You dont need a Bribe right now.");
if(BribeTimer[playerid] == 1) return SendClientMessage(playerid, -1, "You cant do this right now.");

SetPlayerWantedLevel(playerid, Wanted - 1);
BribeTimer[playerid] = 1;
SetTimerEx("BribeDecrease", false, 300000, "i", playerid);
}
}
return 1;
}

forward BribeDecrease(playerid);
public BribeDecrease(playerid)
{
BribeTimer[playerid] = 0;
return 1;
}




Re: Help With Timer And Saving - moustafa0550 - 05.01.2014

help


Re: Help With Timer And Saving - moustafa0550 - 05.01.2014

help please


Re: Help With Timer And Saving - BlackSirrah239 - 05.01.2014

For saving, you have multiple different methods you can try. Have a look around at these methods:
SQlite, https://sampwiki.blast.hk/wiki/SQLite, https://sampforum.blast.hk/showthread.php?tid=262417;
MySQL, https://sampforum.blast.hk/showthread.php?tid=159785
Y_Ini, https://sampforum.blast.hk/showthread.php?tid=175565, https://sampforum.blast.hk/showthread.php?pid=1138420#pid1138420;

Of course, there are others around and you will probably need to ****** more around the topics for a full understanding.


Re: Help With Timer And Saving - moustafa0550 - 05.01.2014

help plaese guys


Re: Help With Timer And Saving - moustafa0550 - 05.01.2014

help


Re: Help With Timer And Saving - moustafa0550 - 05.01.2014

Help Pleaseeeeeeeeeee ?


Re: Help With Timer And Saving - RedFusion - 05.01.2014

Nobody is going to help you with this, go and learn how to write the code instead.


Re: Help With Timer And Saving - moustafa0550 - 05.01.2014

(((( any one help
please


Re: Help With Timer And Saving - moustafa0550 - 05.01.2014

helpppppppppp please