09.08.2012, 20:19
Thank you so much!
Now, for the people that are bored, i have another question (I know im asking much XD)
I want it as when people get a random item, like a weapon, it sends a ClientMessage to the player saying ''You've found a weapon!''. I need it on all of them. I tried editing the cases, but i dont get a sh*t of it.
Please add the texts to the following:
Greetz, CrazyManiac. (Btw if ur already gettin sick of me, this is my last question. Lmao.)
Now, for the people that are bored, i have another question (I know im asking much XD)
I want it as when people get a random item, like a weapon, it sends a ClientMessage to the player saying ''You've found a weapon!''. I need it on all of them. I tried editing the cases, but i dont get a sh*t of it.
Please add the texts to the following:
Код:
new DisSearchT[MAX_PLAYERS]; // I made it as a per-player global var because multiple players can use your command, right?
new CanNotUseSearch[MAX_PLAYERS]; // This will be used to check whether a player is able to use /search or not
// 0 = can
// 1 = can not
// Now in your command
COMMAND: search(playerid,params[])
{
#pragma unused params
if(CanNotUseSearch[playerid] == 1)
return SendClientMessage(playerid, -1, "You can use this command once every 5 minutes!"), 1;
new rand;
rand = (5);
switch(random(rand) )
{
case 0: SetPlayerHealth(playerid,100);
case 1: SetPlayerArmour(playerid,100);
case 2: GivePlayerWeapon(playerid,24,500);
case 3: GivePlayerWeapon(playerid,30,500);
case 4: GivePlayerMoney(playerid,500);
case 5: GivePlayerMoney(playerid,1000);
}
CanNotUseSearch[playerid] = 1; // set it to 1 = player can not use the /search command
DisSearchT[playerid]= SetTimerEx("ResetSearchStatus", 300000, false, "d", playerid); // this will call the forwarded public ResetSearchStatus which resets the player status
return 1;
}
forward ResetSearchStatus(playerid);
public ResetSearchStatus(playerid)
{
CanNotUseSearch[playerid] = 0; // here he's able to use /search again.
SendClientMessage(playerid, -1, "Now you can use the command /search again.");
return 1;
}

