30.11.2012, 05:03
Yes it's possible
pawn Код:
new money,score,wep;
OnGameModeInit()
{
//code
money = CreatePickup(params..);
score = CreatePickup(params..);
wep = CreatePickup(params..);
return 1;
}
OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == money)
{
new cash = 2000 + random(3000);
new str[128];
GivePlayerMoney(playerid, cash);
format(str, 128, "You have picked up $%i.", cash);
SendClientMessage(playerid, -1, playerid);
return 1;
}
else if(pickupid == score)
{
new sc = random(10);
SetPlayerScore(playerid, GetPlayerScore(playerid) + sc);
new str[60];
format(str,60,"We added %i score to your's",sc);
SendClientMessage(playerid,-1,str);
}
else if(pickupid==wep)
{
new w=0;
for(;w==0 || (w>=19 && w<=21);) { w=random(44);}
new ammo = random(1000);
GivePlayerWeapon(playerid,w,ammo);
new str[128],wname[20];
GetWeaponName(w,wname,20);
if(w == 18) format(wname,20,"Molotov Cocktail");
format(str,128,"You received %s(%i).",wname,ammo);
SendClientMessage(playerid,-1,str);
}
}