14.09.2009, 15:18
About showing who robbed you;
first, add this stock to your script:
It returns playerid's name.
Now, you need to create a string, and format it like this:
send the string as a client message for the victim (id), then:
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:
first, add this stock to your script:
pawn Код:
stock GetPlayerName2(playerid)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
return pname;
}
Now, you need to create a string, and format it like this:
pawn Код:
format(string, sizeof(string), "%s robbed you!", GetPlayerName2(playerid));
pawn Код:
format(string, sizeof(string), "You have robbed %s!", GetPlayerName2(id));
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;
}

