Jump to content

Question

Posted

Salut.

Vreau sa transform o comanda CMD in una if(strcmp(cmdtext.... dar nu imi iese. imi da erori..

CMD:hitman(playerid, params[]) {
	new id, amount, GPlayerName[MAX_PLAYERS], PlayerName[MAX_PLAYERS];
	GetPlayerName(id, GPlayerName, sizeof(GPlayerName));
	GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
	if(sscanf(params, "dd", id, amount)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /hitman <playerid> <amount>");
	if(amount > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You don't have enough money!");
    if(amount < 1) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: The ammount must be greater than 1.");
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected.");
	bounty[id] = bounty[id] + amount;
	GivePlayerMoney(playerid, 0-amount);
	format(szString, sizeof(szString), "* %s (ID:%d) has put a $%d bounty on %s (ID:%d)'s head. (Total: %d) ", PlayerName, playerid, amount, GPlayerName, id, bounty[id]);
	SendClientMessageToAll(COLOR_ORANGE, szString);
	format(szString, sizeof(szString), "* %s (ID:%d) has put a $%d bounty on your head. (Total: %d)", PlayerName, playerid, amount, bounty[id]);
	SendClientMessage(id, COLOR_ORANGE, szString);
	format(szString, sizeof(szString), "9*** [BOUNTY]: %s (ID:%d) has put a $%d bounty on %s (ID:%d)'s head. (Total: %d)", PlayerName, playerid, amount, GPlayerName, id, bounty[id]);
	IRC_GroupSay(gGroupID, IRC_CHANNEL2, szString);
	return 1;
}

Ma puteti ajuta?

200r807.gif

5 answers to this question

Recommended Posts

Posted

NexT." post="127811" timestamp="1357117847"]

Cand ai transformato unde ai lasato? acolo unde era sau ai mutato la OnPlayerCommandPerformed ?

am lasato acolo parca, nu mai stiu  :-(

200r807.gif
Posted

Daca ai transformato in strcmp trebuie sa o muti in callback la OnPlayerCommandPerformed sau cum ai tu cu comenzile strcmp ..

35012l1.png.aee1a3398b9bd9f8eec50574d2cd

Posted

NexT." post="127839" timestamp="1357130747"]

Daca ai transformato in strcmp trebuie sa o muti in callback la OnPlayerCommandPerformed sau cum ai tu cu comenzile strcmp ..

Defapt daca e in STRCMP trebuie pusa la OnPlayerCommandText :)

communitylogosml.png

94.23.120.101:7778

Posted

Pai da dar daca a bagat si sscanf si zcmd in gm eu stiu ca OnPlayerCommandText trebuie sa fie OnPlayerCommandPerformed

35012l1.png.aee1a3398b9bd9f8eec50574d2cd

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.