if(strcmp(cmd, "/cnnnn", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Dastoor: /cnnnn <text> ");
return 1;
}
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;
format(string, sizeof(string), "%s",result);
foreach (Player, i)
{
if(IsPlayerConnected(i) == 1)
{
displayCenterHUDInfo(i, string, 5);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Shoma dastresie kafi baraye anjame inkar ra nadarid !");
return 1;
}
}
CMD:cnnnn(playerid, params[]) { new Text[129]; if(!PLayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, -1, "Shoma dastresie kafi baraye anjame inkar ra nadarid !"); if(sscanf(params, "s[128]", Text)) return SendClientMessage(playerid, -1, "Dastoor: /cnnnn <text> "); foreach(Player, x) { if(IsPlayerConnected(x)) { SendClientMessage(x, -1, Text); //IDK I think your mistake is in 'displayCenterHUDInfo' where the last param is 5. } } return 1; }
Try this.
Код:
CMD:cnnnn(playerid, params[]) { new Text[129]; if(!PLayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, -1, "Shoma dastresie kafi baraye anjame inkar ra nadarid !"); if(sscanf(params, "s[128]", Text)) return SendClientMessage(playerid, -1, "Dastoor: /cnnnn <text> "); foreach(Player, x) { if(IsPlayerConnected(x)) { SendClientMessage(x, -1, Text); //IDK I think your mistake is in 'displayCenterHUDInfo' where the last param is 5. } } return 1; } ZCMD by ZeeX. SSCANF by ******. |