I have a problem.
I 've made this script, but when i type de commands "/r" or "/d" in the chat, there are nothing...
Код:
//=========================Departements des FDL=============================
if(strcmp(cmd, "/departement", true) == 0 || strcmp(cmd, "/d", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
new wstring[128];
new faction = PlayerInfo[playerid][pFaction];
new rank = PlayerInfo[playerid][pRank];
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "[AIDE]: (/d)epartment [departement FDL]");
return 1;
}
if(PlayerInfo[playerid][pFaction] == 0 || PlayerInfo[playerid][pFaction] == 6 || PlayerInfo[playerid][pFaction] == 10 )
{
if(rank == 1)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank1],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
FactionChatLog(wstring);
}
else if(rank == 2)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank2],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
FactionChatLog(wstring);
}
else if(rank == 3)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank3],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
FactionChatLog(wstring);
}
else if(rank == 4)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank4],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
FactionChatLog(wstring);
}
else if(rank == 5)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank5],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
FactionChatLog(wstring);
}
else if(rank == 6)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank6],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
FactionChatLog(wstring);
}
else if(rank == 7)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank7],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
FactionChatLog(wstring);
}
else if(rank == 8)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank8],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
FactionChatLog(wstring);
}
else if(rank == 9)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank9],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
FactionChatLog(wstring);
}
else if(rank == 10)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank10],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_GRAD2, wstring);
FactionChatLog(wstring);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Erreur] Faction invalide !");
}
}
return 1;
}
//=========================Radio des FDL====================================
if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new wstring[128];
new faction = PlayerInfo[playerid][pFaction];
new rank = PlayerInfo[playerid][pRank];
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "[Usage:] (/r)adio");
return 1;
}
if(Muted[playerid])
{
SendClientMessage(playerid, COLOR_GREY, "[Error:] You can not use the radio, You are muted");
return 1;
}
if(PlayerInfo[playerid][pFaction] == 0 || PlayerInfo[playerid][pFaction] == 6 || PlayerInfo[playerid][pFaction] == 10 )
{
if(rank == 1)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank1],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_LSPD, wstring);
FactionChatLog(wstring);
}
else if(rank == 2)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank2],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_LSPD, wstring);
FactionChatLog(wstring);
}
else if(rank == 3)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank3],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_LSPD, wstring);
FactionChatLog(wstring);
}
else if(rank == 4)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank4],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_LSPD, wstring);
FactionChatLog(wstring);
}
else if(rank == 5)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank5],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_LSPD, wstring);
FactionChatLog(wstring);
}
else if(rank == 6)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank6],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_LSPD, wstring);
FactionChatLog(wstring);
}
else if(rank == 7)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank7],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_LSPD, wstring);
FactionChatLog(wstring);
}
else if(rank == 8)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank8],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_LSPD, wstring);
FactionChatLog(wstring);
}
else if(rank == 9)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank9],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_LSPD, wstring);
FactionChatLog(wstring);
}
else if(rank == 10)
{
format(wstring, sizeof(wstring), "** %s %s: %s, terminй.**",DynamicFactions[faction][fRank10],GetPlayerNameEx(playerid),result);
SendFactionTypeMessage(1, COLOR_LSPD, wstring);
FactionChatLog(wstring);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Erreur] Faction invalide");
}
}
return 1;
}
the /r is the police's radio and the /d is the army/police/fbi radio, a departments you understand ?