i dont have a varibal i think this is my script that im useing
Код:
//Top of scrip
new Pickup;
new PlayerMoney;
new PlayerMoneyPickup;
forward Timer(playerid);
public OnGameModeInit()
{
Pickup = CreatePickup(1210, 2, 2019.7742,1344.4839,10.8203);
Return 1;
}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PlayerMoney = GetPlayerMoney(playerid);
PlayerMoneyPickup = CreatePickup(1210, 2, 2019.7742,1344.4839,10.8203);
if(!strcmp(cmdtext, "/opencase", true))
{
new rand = random(3);
switch(rand)
{
case 0:
{
SetPlayerHealth(playerid,0);
SendClientMessage(playerid,0xFFFF00AA, "You Tripped The Explosive");
}
case 1:
{
GivePlayerWeapon(playerid, 35, 15);
SendClientMessage(playerid,0xFFFF00AA, "You Got 15 Well packed rockets");
}
case 2:
{
GivePlayerMoney(playerid,43631);
SendClientMessage(playerid,0xFFFF00AA, "It is Your LUCKY day");
}
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Pickup)
{
GivePlayerMoney(playerid, 1000);
SendClientMessage(playerid, 0x33AA33AA, "You Better Run They Gonna Whant That Money");
SetTimerEx("Timer", 40000, 0, "i", playerid);
DestroyPickup(Pickup);
return 1;
}
if(pickupid == PlayerMoneyPickup)
{
GivePlayerMoney(playerid, PlayerMoney);
DestroyPickup(PlayerMoneyPickup);
return 1;
}
return 1;
}
public Timer(playerid)
{
GivePlayerMoney(playerid, 1000);
SetTimerEx("Timer", 40000, 0, "i", playerid);
return 1;
}
Thats the script im useing for the whole case i dont think iv put a veribal in
EDIT: also with that if statement i dont know how it go coz i find it hard to this kinnda stuff but im learning so let me try
if((the veribale) == 1)
Rand = random(3)
or something like that i dont know just a gusse