#1

Hello, if player pick pickup example id 1276 and if kill player Get $1000 and if he death relic removed and if he dont have relic and kill player get $500 who can make this ?
Thanks for your time.
Reply
#2

Reply
#3

pawn Код:
#include <a_samp>

new Pickup;
new HasPickup[MAX_PLAYERS];

public OnGameModeInit()
{
      Pickup = CreatePickup(....);
      return 1;
}
public OnPlayerPickupPickup(playerid, pickupid)
{
    if(pickupid == Pickup)
    {
         HasPickup[playerid] = 1;
         SendClientMessage(playerid, -1, "..You got a Relic");
    }
    return 1;
}
public OnPlayerConnect(playerid)
{
   HasPickup[playerid] = 0;
   return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
     if(HasPickup[killerid] == 1)
     {
         GivePlayerMoney(killerid, 1000);
         SendClientMessage(killerid, -1, "You killed a person and got 1000$ because you own a relic");
         Return 0;
     }
     else if(HasPickup[killerid] == 0)
     {
         SendClientMessage(killerid, -1, "You killed a person and got 5000$ because you don't own a relic");
         GivePlayerMoney(killerid, 500);
          return 0;
     }
     if(HasPickup[playerid] == 1)
     {
        HasPickup[playerid] = 0;
        SendClientMessage(playerid, -1, "You've been killed you lost your relic");
        return 0;
      }
      if(HasPickup[playerid] == 0)
     {
        SendClientMessage(killerid, -1, "You've been killed");
        return 0;
      }
      return 1;
}
Reply
#4

I didn't understand a word now.. Please explain abit better?
Reply
#5

Just change this CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);
to the pickup and location you want I coded everything for you.
Reply
#6

Thanks so much man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)