Posts: 149
Threads: 59
Joined: Jan 2013
Reputation:
0
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.
Posts: 1,297
Threads: 17
Joined: Apr 2011
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;
}
Posts: 1,072
Threads: 168
Joined: Aug 2012
Reputation:
0
I didn't understand a word now.. Please explain abit better?
Posts: 1,297
Threads: 17
Joined: Apr 2011
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.