02.12.2010, 19:16
hi,
id like to script a rank system: as soon as someone has 20 kills he is promoted to noob killer, with 100 kills hell be a grammy shooter and so on.
Is it possible to script it like that:
If its possible with this code somehow, where do i have to paste it in and what do i have to add??
regards.
id like to script a rank system: as soon as someone has 20 kills he is promoted to noob killer, with 100 kills hell be a grammy shooter and so on.
Is it possible to script it like that:
pawn Код:
{
switch(kills[playerid])
{
case 0:
{
if(kills[playerid] == 20)
{
Rank[playerid]++;
SendClientMessage(playerid,0x78FF6CAA,"Congratulations! You promoted to rank noob shooter, +$200!");
GivePlayerMoney(playerid,200);
}
}
case 1:
{
if(kills[playerid] == 100)
{
Rank[playerid]++;
SendClientMessage(playerid,0x78FF6CAA,"Congratulations! You promoted to grammy shooter, and earned $1200!");
GivePlayerMoney(playerid,1200);
}
}
case 2:
{
if(kills[playerid] == 500)
{
Rank[playerid]++;
SendClientMessage(playerid,0x78FF6CAA,"Congratulations! You promoted to what ever, and earned $2300!");
GivePlayerMoney(playerid,2300);
}
}
}
}
if(strcmp(cmdtext,"/stats",true)==0)
{
new str[50];
format(str,sizeof(str),"Your rank is %d",GetPlayerRank(playerid));
SendClientMessage(playerid,0xFFFF00AA,str);
return 1;
}
stock GetPlayerRank(playerid)
{
return Rank[playerid];
}
regards.