/Rob command need help ')
#4

About showing who robbed you;
first, add this stock to your script:
pawn Код:
stock GetPlayerName2(playerid)
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    return pname;
}
It returns playerid's name.

Now, you need to create a string, and format it like this:
pawn Код:
format(string, sizeof(string), "%s robbed you!", GetPlayerName2(playerid));
send the string as a client message for the victim (id), then:
pawn Код:
format(string, sizeof(string), "You have robbed %s!", GetPlayerName2(id));
send it again, this time for the robber.

For the random money, you need to get a random number, and check the victims money, if it's less than the random, just take al of his cash!
You could use RandomEx:
pawn Код:
stock RandomEx(min, max) // by ******
{
    return random(max - min) + min;
}
Reply


Messages In This Thread
/Rob command need help ') - by Pawno_Master - 14.09.2009, 14:32
Re: /Rob command need help ') - by Pawno_Master - 14.09.2009, 15:13
Re: /Rob command need help ') - by Correlli - 14.09.2009, 15:15
Re: /Rob command need help ') - by Clavius - 14.09.2009, 15:18
Re: /Rob command need help ') - by Calgon - 14.09.2009, 15:19

Forum Jump:


Users browsing this thread: 1 Guest(s)