20.03.2010, 11:52
Hello, I have been experimenting with a TPM command, do you think this will work, if not, can oyu please help me to fix it?
Thanks
Код:
if(strcmp("/tpm", cmd, true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[256]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GREY, " USAGE: /tpm [text]"); return 1; } format(string, sizeof(string), "TPM: %s: %s", sendername, result); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(gTeam[i] == gTeam[playerid]) SendClientMessage(playerid, PM_INCOMING_COLOR, string); } return 0; } return 1; }