SA-MP Forums Archive
need help on /ask - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: need help on /ask (/showthread.php?tid=409006)



need help on /ask - DerickClark - 20.01.2013

hi,its not showing the question to Admin just say your question sent to oline admins!
Here my code

Код:
COMMAND:ask(playerid,params[])
{
    new text[128];
    if(sscanf(params, "s[128]", text))SendClientMessage(playerid, 0xAA3333AA, "Usage: /ask [Text]");
    SendClientMessage(playerid,0xAA3333AA,"Your question has been sent to online admins!");
    new Name[MAX_PLAYER_NAME], KickMessage[128];
    GetPlayerName(playerid, Name, sizeof(Name));
    if(APlayerData[playerid][PlayerLevel] >= 2)format(KickMessage, sizeof(KickMessage), "[Question]:%s(%d):%s", Name, playerid,text);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) == 0) SendClientMessage(i,0xAA3333AA, KickMessage);
    }
    return 1;
}



Re: need help on /ask - Jewell - 20.01.2013

This should be works

Код:
COMMAND:ask(playerid,params[])
{
    new string[128];
    if(sscanf(params, "s[128]", params))return SendClientMessage(playerid, 0xAA3333AA, "Usage: /ask [Text]");
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    format(string, sizeof(string), "[Question]:%s(%d):%s", Name, playerid,params);
    for(new i = 0; i < MAX_PLAYERS; i++){
    if(IsPlayerConnected(i) && APlayerData[playerid][PlayerLevel] >= 2 ) SendClientMessage(i,0xAA3333AA, string);
    }
    SendClientMessage(playerid,0xAA3333AA,"Your question has been sent to online admins!");
    return 1;
}



Re: need help on /ask - DerickClark - 20.01.2013

Quote:
Originally Posted by Jewell
Посмотреть сообщение
This should be works

Код:
COMMAND:ask(playerid,params[])
{
    new string[128];
    if(sscanf(params, "s[128]", params))return SendClientMessage(playerid, 0xAA3333AA, "Usage: /ask [Text]");
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    format(string, sizeof(string), "[Question]:%s(%d):%s", Name, playerid,params);
    for(new i = 0; i < MAX_PLAYERS; i++){
    if(IsPlayerConnected(i) && APlayerData[playerid][PlayerLevel] >= 2 ) SendClientMessage(i,0xAA3333AA, string);
    }
    SendClientMessage(playerid,0xAA3333AA,"Your question has been sent to online admins!");
    return 1;
}
Ty it work