public OnPlayerText(playerid, text[]) { new chat[200], name[MAX_PLAYER_NAME], msg[128]; if(IsPlayerAdmin(playerid) && text[0] == '#') { new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, MAX_PLAYER_NAME); format(msg, sizeof(msg), "[ADMIN CHAT]%s(%d): %s", pName, playerid, text[1]); SendMessageToAdmins(msg); } else { GetPlayerName(playerid, name, sizeof(name)); format(chat, sizeof(chat), "(%d): {EBFF00}%s{FFFFFF}",playerid, text); SendPlayerMessageToAll(playerid, chat); return 0; }
public OnPlayerText(playerid, text[])
{
new chat[200], name[MAX_PLAYER_NAME], msg[128];
if(IsPlayerAdmin(playerid) && text[0] == '#')
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(msg, sizeof(msg), "[ADMIN CHAT]%s(%d): %s", pName, playerid, text[1]);
SendMessageToAdmins(msg);
}
else
{
GetPlayerName(playerid, name, sizeof(name));
format(chat, sizeof(chat), "(%d): {EBFF00}%s{FFFFFF}",playerid, text);
SendPlayerMessageToAll(playerid, chat);
}
return 0;
}
public OnPlayerText(playerid, text[])
{
new chat[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
if(IsPlayerAdmin(playerid) && text[0] == '#')
{
format(chat, sizeof(chat), "[ADMIN CHAT] %s(%d): %s", pName, playerid, text);
SendMessageToAdmins(chat);
return 0;
}
format(chat, sizeof(chat), "(%d): {EBFF00}%s{FFFFFF}", playerid, text);
SendPlayerMessageToAll(playerid, chat);
return 0;
}
try this
PHP код:
|
C:\Users\User\Desktop\SCRIPT\my creation\pawno\include\sscanf2.inc(305) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\pawno\include\sscanf2.inc(305) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\pawno\include\sscanf2.inc(365) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\pawno\include\sscanf2.inc(365) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(115) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(129) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(236) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(250) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(317) : warning 219: local variable "pName" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(331) : error 010: invalid function or declaration C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(333) : error 010: invalid function or declaration C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(335) : error 010: invalid function or declaration C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(341) : error 021: symbol already defined: "GetPlayerName" C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(353) : error 010: invalid function or declaration C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(454) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(482) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(550) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(567) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(803) : warning 219: local variable "string" shadows a variable at a preceding level C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(1140) : warning 203: symbol is never used: "pName" C:\Users\User\Desktop\SCRIPT\my creation\gamemodes\smile.pwn(1140) : warning 203: symbol is never used: "string" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
PHP код:
|
stock SendMessageToAdmins(text[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerAdmin(i)) { SendClientMessage(i, COLOR_RED, text); } } }
public OnPlayerText(playerid, text[]) { new chat[128], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, MAX_PLAYER_NAME); if(IsPlayerAdmin(playerid) && text[0] == '#') { format(chat, sizeof(chat), "[ADMIN CHAT] %s(%d): %s", pName, playerid, text); SendMessageToAdmins(chat); return 0; } format(chat, sizeof(chat), "(%d): {EBFF00}%s{FFFFFF}", playerid, text); SendPlayerMessageToAll(playerid, chat); return 0; } //================================================== ==========================// switch(xTestBusy) { case true: { if(!strcmp(xChars, text, false)) { new string[128], pName[MAX_PLAYER_NAME] ; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "{FFFFFF}[{00CED1}REACTION{FFFFFF}]: {F81414}%s {FFFFFF}has won the reaction test!", pName); SendClientMessageToAll(GREEN, string); format(string, sizeof(string), "You have earned $%d + %d score.", xCash, xScore); SendClientMessage(playerid, COLOR_YELLOW, string); GivePlayerMoney(playerid, xCash); SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore); xReactionTimer = SetTimer("xReactionTest", TIME, 1); xTestBusy = false; } } } return 1; } |