Remove object after 10 seconds
#1

I want the object disappear after 10 second if no one pick it..

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
cmd[256];
    new 
idx;
    new 
string[256];
    new 
sendername[MAX_PLAYER_NAME];
    
cmd strtok(cmdtextidx);
    if(
strcmp(cmd"/dropgun"true) == || strcmp(cmd"/dgun"true) == 0)
    {
        new 
gunID GetPlayerWeapon(playerid);
        new 
gunAmmo GetPlayerAmmo(playerid);
        if(
gunID != && gunAmmo != 0)
        {
            new 
MAX_OBJ+1;
            for(new 
0sizeof(ObjCoords); a++)
            {
                if(
ObjCoords[a][0] == 0.0)
                {
                    
a;
                    break;
                }
            }
            if(
MAX_OBJ) return SendClientMessage(playerid0x33AA3300"You can not throw weapons at the moment, try back later!!");
            new 
gunname[25];
            new 
buffer[100];
            
GetWeaponNameEx(gunIDgunnamesizeof(gunname));
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
format(buffersizeof(buffer), "You threw %s"gunname);
            
SendClientMessage(playerid0x33AA3300buffer);
            
RemovePlayerWeapon(playeridgunID);
            
ObjectID[f][0] = gunID;
            
ObjectID[f][1] = gunAmmo;
            
GetPlayerPos(playeridObjCoords[f][0], ObjCoords[f][1], ObjCoords[f][2]);
            
object[f] = CreateObject(GunObjects[gunID][0],ObjCoords[f][0],ObjCoords[f][1],ObjCoords[f][2]-1,93.7,120.0,120.0);
            {
            
format(stringsizeof(string), "* %s drop their %s."sendernamegunname);
            }
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
ApplyAnimation(playerid"BOMBER""BOM_Plant"4.000000);
            return 
1;
        }
    } 
Reply


Messages In This Thread
Remove object after 10 seconds - by pojefauzan - 23.12.2010, 06:12
Re: Remove object after 10 seconds - by Steven82 - 23.12.2010, 06:22
Re: Remove object after 10 seconds - by pojefauzan - 23.12.2010, 06:43
Re: Remove object after 10 seconds - by Steven82 - 23.12.2010, 06:50
Re: Remove object after 10 seconds - by pojefauzan - 23.12.2010, 06:58
Re: Remove object after 10 seconds - by Steven82 - 23.12.2010, 07:18

Forum Jump:


Users browsing this thread: 1 Guest(s)