Pickup abuse..
#1

I have this code
pawn Code:
if(pickupid == copdutypoint)
{
    if(GetPlayerTeam(playerid) == 100)
    {
        GivePlayerWeapon(playerid, 3, 1);
        GivePlayerWeapon(playerid, 22, 99);
        GivePlayerWeapon(playerid, 27, 50);
        new string[250];
        new Name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, sizeof(Name));

        format(string,sizeof(string),"%s has gone on duty and collected their guns",Name);
        SendClientMessageToAll(0x33AA33AA, string);
    }
    else
    SendClientMessage(playerid, 0xAA3333AA, "You can't go on duty! You're not a cop");
}
It gives them guns with some ammo, but if you stay there after collecting your first set of guns.. then stay in the checkpoint for another few secs you get more. then wait again.. more how can I set it to wait 2 minutes before collecting more?
Reply
#2

Code:
if(pickupid == copdutypoint)
{
    if(GetPlayerTeam(playerid) == 100)
    {
		if(GetTickCount()-GetPVarInt(playerid,"CopDutyPickupMS")>120000)
		{
			SetPVarInt(playerid,"CopDutyPickupMS",GetTickCount());
			GivePlayerWeapon(playerid, 3, 1);
			GivePlayerWeapon(playerid, 22, 99);
			GivePlayerWeapon(playerid, 27, 50);
			new string[250];
			new Name[MAX_PLAYER_NAME];
			GetPlayerName(playerid, Name, sizeof(Name));
			format(string,sizeof(string),"%s has gone on duty and collected their guns",Name);
			SendClientMessageToAll(0x33AA33AA, string);
		}
		else
		{
			GameTextForPlayer(playerid,"you already refilled some shit - go away!",4000,4);
		}
    }
    else
    SendClientMessage(playerid, 0xAA3333AA, "You can't go on duty! You're not a cop");
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)