#define TEXT_OUTPUT 128
CMD:a(playerid, params[])
{
new text[TEXT_OUTPUT];
if(PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_MESSAGES[6], "No Autorizado!");
if(sscanf(params, "s[" #TEXT_OUTPUT "]", text)) return SendClientMessage(playerid, COLOR_MESSAGES[6], "Uso: /A [Texto]");
format(text, sizeof(text), "%s %s %s: %s",LOGO_STAFF, AdminsRangosChat[PlayerInfo[playerid][Admin]], GetName(playerid), text);
AdminChatStream(COLOR_MESSAGES[3], text);
return 1;
}
stock AdminChatStream(col, string[])
{
foreach(new i : Player)
{
if(PlayerInfo[i][Admin] >= 1 && IsPlayerConnected(i) && PlayerInfo[i][IsLoggedIn] == true)
{
SendClientMessage(i, col, string);}
}return 1;
}
if(!sscanf(...
CMD:a(playerid, params[]) { new text[128]; if(PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_MESSAGES[6], "No Autorizado!"); if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_MESSAGES[6], "Uso: /A [Texto]"); format(text, sizeof(text), "%s %s %s: %s",LOGO_STAFF, AdminsRangosChat[PlayerInfo[playerid][Admin]], GetName(playerid), text); AdminChatStream(COLOR_MESSAGES[3], text); return 1; }
y probaste asi? ._.
Код:
CMD:a(playerid, params[]) { new text[128]; if(PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_MESSAGES[6], "No Autorizado!"); if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_MESSAGES[6], "Uso: /A [Texto]"); format(text, sizeof(text), "%s %s %s: %s",LOGO_STAFF, AdminsRangosChat[PlayerInfo[playerid][Admin]], GetName(playerid), text); AdminChatStream(COLOR_MESSAGES[3], text); return 1; } |
CMD:a(playerid, params[])
{
new text[128];
if(PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_MESSAGES[6], "No Autorizado!");
if(!sscanf(params, "s[128]", text))
{
format(text, sizeof(text), "%s %s %s: %s",LOGO_STAFF, AdminsRangosChat[PlayerInfo[playerid][Admin]], GetName(playerid), text);
AdminChatStream(COLOR_MESSAGES[3], text);
}
else SendClientMessage(playerid, COLOR_MESSAGES[6], "Uso: /A [Texto]");
return 1;
}
PHP код:
![]() |
CMD:a(playerid, params[])
{
new text[128];
if(PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_MESSAGES[6], "No Autorizado!");
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_MESSAGES[6], "Uso: /A [Texto]");
else {
format(text, sizeof(text), "%s %s %s: %s",LOGO_STAFF, AdminsRangosChat[PlayerInfo[playerid][Admin]], GetName(playerid), text);
AdminChatStream(COLOR_MESSAGES[3], text);
}
return 1;
}
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team
[00:49:06] filterscripts = "" (string)
[00:49:06]
[00:49:06] Server Plugins
[00:49:06] --------------
[00:49:06] Loading plugin: mysql
[00:49:06] >> plugin.mysql: R41-2 successfully loaded.
[00:49:06] Loaded.
[00:49:06] Loading plugin: Whirlpool
[00:49:06]
[00:49:06] ==================
[00:49:06]
[00:49:06] Whirlpool loaded
[00:49:06]
[00:49:06] ==================
[00:49:06]
[00:49:06] Loaded.
[00:49:06] Loading plugin: sscanf
[00:49:06]
[00:49:06] ===============================
[00:49:06] sscanf plugin loaded.
[00:49:06] Version: 2.8.2
[00:49:06] (c) 2012 Alex "******" Cole
[00:49:06] ===============================
[00:49:06] Loaded.
[00:49:06] Loaded 3 plugins.
[00:49:07]
[00:49:07] Filterscripts
[00:49:07] ---------------
[00:49:07] Loaded 0 filterscripts.
[00:49:07] MySQL connection is successful.
[00:49:07] Number of vehicle models: 0
[00:50:08] [connection] 127.0.0.1:54948 requests connection cookie.
[00:50:09] [connection] incoming connection: 127.0.0.1:54948 id: 0
[00:50:09] Conexiуn entrante IP: 127.0.0.1. Puerto: 54948
[00:50:09] [join] Eloy_Gonzalez has joined the server (0:127.0.0.1)
public OnPlayerCommandPerformed(playerid, cmd[], params[], success)
{
if(!success) return SendClientMessage(playerid, COLOR_MESSAGES[0], "Error N° 1: Este comando no existe, usa /Ayuda para mбs informaciуn");
return 1;
}