31.05.2009, 09:58
hy ppl i need the /ooc chat command
only for admins
/o ---> ((SpLoOsH))
this should look
tnx
only for admins
/o ---> ((SpLoOsH))
this should look
tnx
#include <a_samp> #include <a_samp> #include <dudb> #include <dutils> #include <file> #include <time> #include <utils> #define COLOR_GRAD2 0xBFC0C2FF public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; new string[256]; new giveplayer[MAX_PLAYER_NAME]; new idx, giveplayerid; new sendername[MAX_PLAYER_NAME]; if(strcmp(cmd, "/b", true) == 0)//helyi ooc { if(IsPlayerConnected(playerid)) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[63]; if(length > 63) { while ((idx < 63) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } format(string, sizeof(string), "%s ooc: (( %s... ))", sendername, result); result[idx - offset] = EOS; } else { while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; format(string, sizeof(string), "%s ooc: (( %s ))", sendername, result); } if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /b [ooc text here]"); return 1; } printf("%s", string); } return 1; } return 0; }
new cmd[256]; new string[256]; new idx; new sendername[MAX_PLAYER_NAME]; // --============ OOC ===========-- // if(strcmp(cmd, "/o", true) == 0)//helyi ooc { if(IsPlayerConnected(playerid)) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[63]; if(length > 63) { while ((idx < 63) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } format(string, sizeof(string), "%s ooc: (( %s... ))", sendername, result); result[idx - offset] = EOS; } else { while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; format(string, sizeof(string), "%s ooc: (( %s ))", sendername, result); } if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USE: /o [OOC text here]"); return 1; } printf("%s", string); } return 1; }
Originally Posted by //exora
"May 31, 2009"
nice bump, lol. |