SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/11/2012, 06:08 PM   #1
ThePhill97
Little Clucker
 
Join Date: Nov 2012
Posts: 19
Reputation: 0
Default Pickup abuse..

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?
ThePhill97 is offline   Reply With Quote
Old 23/11/2012, 06:14 PM   #2
Babul
High-roller
 
Babul's Avatar
 
Join Date: Sep 2009
Location: in a cement block
Posts: 1,781
Reputation: 266
Default Re: Pickup abuse..

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");
}
__________________
FireWorks

new sscanf2 custom specifiers available for Download, read the Release Topic
Babul is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pause/Esc abuse happyface General 0 13/04/2011 08:56 PM
[Tutorial] How to Use Variables to Prevent Abuse Jacob_Venturas Tutorials 6 12/11/2010 05:42 AM
Abusers live to abuse. BP13 Help Archive 14 04/03/2010 07:25 AM
/handsup abuse killar456 Help Archive 2 13/05/2009 06:49 PM


All times are GMT. The time now is 07:59 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.