30.10.2015, 08:42
Nice tutorial. I would recommend using an enum to store dialog names. If you just use an ID, there's a chance you'll accidentally use that ID again and that can be confusing.
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
- It's possible to declare just one string variable and re-format it multiple times (So there's no need for string2, string3 etc. unless you know one string might become longer than the other one. For example, the string length of a textdraw can be 1024 characters and the string in SendClientMessage can only be up to 144 characters)
Example:
https://sampwiki.blast.hk/wiki/Limits
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
- It's possible to declare just one string variable and re-format it multiple times (So there's no need for string2, string3 etc. unless you know one string might become longer than the other one. For example, the string length of a textdraw can be 1024 characters and the string in SendClientMessage can only be up to 144 characters)
Example:
Код:
format(string, sizeof(string), "You've been kicked by Admin %s | Reason: %s", PlayerInfo[playerid][Name], reason); SendClientMessage(targetid, -1, string); KickEx(targetid); format(string, sizeof(string), "You've kicked %s | Reason: %s", PlayerInfo[targetid][Name], reason); SendClientMessage(playerid, -1, string); format(string, sizeof(string), "%s has been kicked by Admin %s | Reason: %s", PlayerInfo[targetid][Name], PlayerInfo[playerid][Name], reason); SendClientMessageToAll(-1, string);