help with a few things
#1

In OnPlayerDeath, how can i check if the reason for death is by /kill? is there like an id for that?

also, i have a /rob command for the casino. how would i make random money to be given, and display it:

format(string, sizeof(string), "%s has robbed caligulas casino and got a total of [amnt. of money]",pName);

Код:
 if(strcmp(cmdtext, "/rob", true) == 0)
	{
	if(GetPlayerInterior(playerid) == 1)
	{
	SendClientMessage(playerid, COLOR_GREEN, "== You robbed the casino and got $10,000");
	SendClientMessage(playerid, COLOR_YELLOW, "== Get to the safe zone to clear wanted level.");
  new pName[MAX_PLAYER_NAME];
  new string [265];
	GetPlayerName(playerid,pName,sizeof(pName));
  format(string, sizeof(string), "%s has robbed caligulas casino and got a total of $10,000",pName);
  SendClientMessageToAll(COLOR_RED,string);
	GivePlayerMoney(playerid,10000);
	SetPlayerWantedLevel(playerid,6);
	}
	else
	{
	SendClientMessage(playerid, COLOR_RED, "== You must be in Caligulas Casino to rob.");
	}
Reply
#2

In OnPlayerDeath, how can i check if the reason for death is by /kill? is there like an id for that?

Yes 255.


also, i have a /rob command for the casino. how would i make random money to be given, and display it:

format(string, sizeof(string), "%s has robbed caligulas casino and got a total of [amnt. of money]",pName);

Код:
//top
new CasinoCash[6] = {100,300,3000,4534,47,456};
and this
Код:
new rand = random(sizeof(CasinoCash));
format(string, sizeof(string), "%s has robbed caligulas casino and got a total of %d $",pName,rand);
GivePlayerMoney(playerid,rand);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)