Help With Timer And Saving
#1

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;
}

Reply
#2

help
Reply
#3

help please
Reply
#4

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.
Reply
#5

help plaese guys
Reply
#6

help
Reply
#7

Help Pleaseeeeeeeeeee ?
Reply
#8

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

(((( any one help
please
Reply
#10

helpppppppppp please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)