OnPlayerPickupPickup
#1

Hello, i need help with that and my problem is when someone using fake killing he get banned (yeah, that's fine) but the pickups duplicate so that on a map many many pickups are and players abusing that, so how to fix that it don't duplicate?

Код:
new randomxp = random(35);
format(string,sizeof(string),"~w~+~g~%d ~w~XP",randomxp);
GameTextForPlayer(playerid,string,4000,5);
pInfo[playerid][pXP] += randomxp;
DestroyPickup(meatDrops[playerid]);
Reply
#2

Create a timer to create the pickup
like 2 seconds, if the player is connected, create the pickup, if the player isn't connected return 0;
Reply
#3

pawn Код:
if(PickedUpPickup[playerid] != 0)//If they have picked up a pickup...
    {
        SendClientMessage(playerid, COLOR_ORANGE, "**[SERVER]** {FFFFFF}- You need to wait at least {FF0000}5 seconds{FFFFFF} before picking up another pickup!");
        return 1;//Ends the code, not allowing the pickup.
    }
    PickedUpPickup[playerid] = 1;//Sets the 'PickedUpPickup' variable to has picked somthing up.
    SetTimerEx("PickedUpPickupReset", 4500, false, "i", playerid);
Bottom of your script:

pawn Код:
public PickedUpPickupReset (playerid)//The timer that resets the variable 'PickedUpPickup' to 0 (Nothing picked up within 4.5 seconds).
{
      PickedUpPickup[playerid] = 0;
      return 1;
}
Enjoy!

P.S. - Credit for that goes to: jakejohnsonusa.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)