Random Loot Spawn
#1

How do I change the spawn of this loot
PHP код:
RLootObjects[0] = CreateObject(19054, -1956.1447287.109135.4688,   87.72005, -23.879960.00000); 
to a random one. I made the random spawn float variable already. The problem is only here. This is how a player will receive the loot.
PHP код:
if (newkeys KEY_NO)
    {
        if(
IsValidObject(LootObjects[0]) && IsPlayerInRangeOfPoint(playerid,2.0,-1956.1447287.109135.4688))
        {
            
AddItem(playerid,"M4A1",1);
            
SendClientMessage(playeridCOLOR_GREEN"* 1 M4A1 has been added to your inventory");
            
DestroyObject(LootObjects[0]);
        } 
How do I change
Код:
if(IsValidObject(LootObjects[0]) && IsPlayerInRangeOfPoint(playerid,2.0,-1956.1447, 287.1091, 35.4688))
so that when the player is in range of the random loot spawn, he will get the M4A1. Cause I just cant use the random float spawn.

Sorry if I can't explain it well. I'm really confused on this that I don't even know how to explain it.

EDIT: DON'T MIND
Quote:

How do I change the spawn of this loot
PHP код:
RLootObjects[0] = CreateObject(19054, -1956.1447287.109135.4688,   87.72005, -23.879960.00000); 
to a random one.

Reply
#2

Tried my best to simplify it:

Something like this
PHP код:
IsPlayerInRangeOfPoint(playerid,2.0,LootObjects[0]); 
but translated from my confusing language to PAWN language
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)