Entгo, coloquei um FS no meu servidor de roubo e tipo, quando eu vou roubar tem que esperar os minutos para terminar o roubo para mim ganhar o dinheiro, quando eu morro eu continuo ganhando o dinheiro eu queria colocar para, quando eu morrer nгo ganhar dinheiro, serб que й possнvel?
Code:
#include <a_samp>
#define MaxPlayers (20) // Quantidade total de player em seu servidor
#define cX 153.1188 // Coordenada X do roubo
#define cY -64.5729 // Coordenada Y do roubo
#define cZ 1.5781 // Coordenada Z do roubo
#define IconeRoubo 1274
#define PickupCor 0x008080FF
#define TempoRoubo 1 // Tempo em minutos para esperar o roubo ser concluнdo
#define AReceber 10000 // Valor em dуlares que o ladrгo irб receber
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
static Roubando[MaxPlayers];
forward Roubou(playerid);
public OnFilterScriptInit()
{
print("\n~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~");
print(" [FS] Roubar\n");
print(" [KoS] Shickcard\n");
print("~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\n");
CreatePickup(IconeRoubo, 1, cX, cY, cZ, -1);
Create3DTextLabel("Cofre", PickupCor, cX, cY, cZ, 30.0, 0);
return 1;
}
public OnFilterScriptExit()
{
for(new i=0; i<MaxPlayers; i++)
{
Roubando[i] = 0;
}
return 1;
}
main()
{
print("\n~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~");
print(" [FS] Roubar\n");
print(" [KoS] Shickcard\n");
print("~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~\n");
}
public OnPlayerConnect(playerid)
{
Roubando[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
Roubando[playerid] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
Roubando[playerid] = 0;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
static Matou[MAX_PLAYER_NAME], Morreu[MAX_PLAYER_NAME], sStr[90];
GetPlayerName(killerid, Matou, sizeof(Matou));
GetPlayerName(playerid, Morreu, sizeof(Morreu));
format(sStr, sizeof(sStr), "[NOTНCIAS] %s[%d] matou o ladrгo %s[%d]", Matou, killerid, Morreu, playerid);
if(Roubando[playerid] == 1)
{
SendClientMessage(playerid, 0xE31919FF, "[~] Vocк morreu quando estava roubando!");
Roubando[playerid] = 0;
return 1;
}
if(Roubando[killerid] == 1)
{
SendClientMessage(playerid, 0xE31919FF, "[~] Vocк matou o ladrгo!");
Roubando[killerid] = 0;
return 1;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(creditosfs, 10, cmdtext);
return 0;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, cX, cY, cZ)) // Tecla » [ \| ]
{
static Ladrao[MAX_PLAYER_NAME], sStr[70];
GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
if(Roubando[playerid] == 1) return SendClientMessage(playerid, 0xE31919FF, "[~] Vocк jб estб assaltando!");
format(sStr, sizeof(sStr), "[NOTНCIAS] %s[%d] estб roubando um local!", Ladrao, playerid);
SendClientMessageToAll(0xE31919FF, sStr);
format(sStr, sizeof(sStr), "Espere no local %d minutos para concluir o saqueamento!", TempoRoubo);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+1);
SendClientMessage(playerid, 0xC9C9C9FF, sStr);
SetTimer("Roubou", 60000*TempoRoubo, false);
Roubando[playerid] = 1;
return 1;
}
return 1;
}
public Roubou(playerid)
{
new Grana = random(AReceber);
static Ladrao[MAX_PLAYER_NAME], sStr[100];
GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
GivePlayerMoney(playerid, Grana);
format(sStr, sizeof(sStr), "[NOTНCIAS] A Polнcia demorou e %s[%d] conseguiu roubar o local!", Ladrao, playerid);
SendClientMessageToAll(0xE31919FF, sStr);
Roubando[playerid] = 0;
return 1;
}