Jump to content

[PAWN] System pick-up + iconita cu inima si arma


Bogdanw0w
 Share

Recommended Posts

Acest system a fost realizat in 15 minute si sper sa va ajute.

O sa revin cu un system de WAR, identic cu cel care ruleaza toate cele 4 servere RPG.

Script -

 

#include

#define MAPICON_WAR 16


new pickupwar[MAX_PLAYERS];
new type[MAX_PLAYERS];

public OnPlayerDeath(playerid,killerid,reason)
{
if(killerid != INVALID_PLAYER_ID)
{
// aici se adauga conditii ca playerul sa fie intr-o factiune, si sa participe la warr-ul respectiv
new Float:x,Float:y,Float:z,string[128],namep[MAX_PLAYER_NAME],typepick,typebonus[16],typebonus2[16],iconita;
GetPlayerName(playerid,namep,sizeof(namep));
GetPlayerPos(playerid,x,y,z);

new randomv = random(2);

switch(randomv)
{
case 0:
{
typepick = 348;
iconita = 18;
format(typebonus,sizeof(typebonus),"armament");
format(typebonus2,sizeof(typebonus2),"arma");
}
case 1:
{
typepick = 1240;
iconita = 21;
format(typebonus,sizeof(typebonus),"viata");
format(typebonus2,sizeof(typebonus2),"inima");
}
}

pickupwar[playerid] = CreatePickup(typepick, 2, x, y, z, -1);
type[playerid] = typepick;

format(string,sizeof(string),"{FFCC00}%s a murit poti primi %s daca te duci la %s de pe minimap !",namep,typebonus,typebonus2);

for(new i; i <= GetPlayerPoolSize(); i++)
{
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(playerid, 30, x, y, z)) // si sa fie in warr.
{
SetPlayerMapIcon(i, MAPICON_WAR, x, y, z, iconita, 0, MAPICON_LOCAL);
SendClientMessage(i,-1,string);
}
}
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i; i <= GetPlayerPoolSize(); i++)
{
if(IsPlayerConnected(i))
{
if(pickupid == pickupwar)
{
DestroyPickup(pickupwar);
RemovePlayerMapIcon(i, MAPICON_WAR);
switch(type)
{
case 348:
{
new randomv = random(4);
switch(randomv)
{
case 0:
{
GivePlayerWeapon(playerid,24,25);
SendClientMessage(playerid,-1,"Ai primit o arma deagle cu 25 gloante !");
}
case 1:
{
GivePlayerWeapon(playerid,26,15);
SendClientMessage(playerid,-1,"Ai primit o arma sawedoff cu 15 gloante !");
}
case 2:
{
GivePlayerWeapon(playerid,28,150);
SendClientMessage(playerid,-1,"Ai primit o arma uzi cu 150 gloante !");
}
case 3:
{
GivePlayerWeapon(playerid,31,200);
SendClientMessage(playerid,-1,"Ai primit o arma m4 cu 200 gloante !");
}
case 4:
{
GivePlayerWeapon(playerid,30,150);
SendClientMessage(playerid,-1,"Ai primit o arma ak47 cu 150 gloante !");
}
}
}
case 1240:
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health >= 90)
{
SetPlayerHealth(playerid,health+5);
SendClientMessage(playerid,-1,"Ai primit viata 5 hp in plus !");
}
else if(health >= 80)
{
SetPlayerHealth(playerid,health+10);
SendClientMessage(playerid,-1,"Ai primit viata 30 hp in plus !");
}
else if(health >= 70)
{
SetPlayerHealth(playerid,health+15);
SendClientMessage(playerid,-1,"Ai primit viata 15 hp in plus !");
}
else if(health >= 60)
{
SetPlayerHealth(playerid,health+20);
SendClientMessage(playerid,-1,"Ai primit viata 20 hp in plus !");
}
else if(health >= 50)
{
SetPlayerHealth(playerid,health+25);
SendClientMessage(playerid,-1,"Ai primit viata 25 hp in plus !");
}
else if(health >= 40)
{
SetPlayerHealth(playerid,health+30);
SendClientMessage(playerid,-1,"Ai primit viata 30 hp in plus !");
}
else if(health >= 30)
{
SetPlayerHealth(playerid,health+35);
SendClientMessage(playerid,-1,"Ai primit viata 35 hp in plus !");
}
else
{
SetPlayerHealth(playerid,health + 50);
SendClientMessage(playerid,-1,"Ai primit viata 50 hp in plus !");
}
}
}
}
}

}
return 1;
}

 

 

Poze :

 

 

Edited by Cdorsu
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.