09.06.2013, 10:46
If you're a beginner you might aswel learn the modern techniques from the start instead of using outdated and very inefficient code (strcmp, strtok).
You'll need the following for this:
- sscanf
- zcmd (or equivalent)
EDIT:
That's like saying you will only use Assembly and refuse to use Java because it's more evolved. With that attitude you will not (read:never) be able to make good scripts.
Scripting is NOT about copying other people's code and adding your text. I can asume that the script you have uses strcmp -- newsflash! strcmp is outdated so either convert it to a better alternative or stop scripting all together. Asking people to improve on your already horrible code and refusing to take perfectly valid modern techniques as the solution just makes us not want to help you again.
You'll need the following for this:
- sscanf
- zcmd (or equivalent)
pawn Код:
COMMAND:b(playerid, params[]) {
new text[128];
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0xFF0000, "Usage: /b <message>");
new string[128 + MAX_PLAYER_NAME];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "[OOC]%s: (( %s ))", pname, text);
ProxDetector(7.0, playerid, string, COLOR_LIGHTGREEN, COLOR_LIGHTGREEN, COLOR_LIGHTGREEN, COLOR_LIGHTGREEN, COLOR_LIGHTGREEN);
return 1;
}
Quote:
PS: I don't use ZCMD and i never want to. |
Scripting is NOT about copying other people's code and adding your text. I can asume that the script you have uses strcmp -- newsflash! strcmp is outdated so either convert it to a better alternative or stop scripting all together. Asking people to improve on your already horrible code and refusing to take perfectly valid modern techniques as the solution just makes us not want to help you again.