Jump to content
  • 0

Cum fac comanda whisper la level 4


michael.luciano

Question

Am si eu o problema , vreau sa fac comanda de /whisper de la level 4 si nu stiu cum , ma poate ajuta cineva ?

Comanda /whisper :

[pawn]if(strcmp(cmd, "/whisper", true) == 0 || strcmp(cmd, "/w", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(gPlayerLogged[playerid] == 0)

        {

            SendClientMessage(playerid, COLOR_GREY, "  You havent logged in yet!");

            return 1;

        }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/w)hisper [playerid/PartOfName] [whisper text]");

return 1;

}

giveplayerid = ReturnUser(tmp);

if (IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

GetPlayerName(playerid, sendername, sizeof(sendername));

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

new length = strlen(cmdtext);

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, "USAGE: (/w)isper [playerid/PartOfName] [whisper text]");

return 1;

}

format(string, sizeof(string), "%s whispers: %s", sendername, (result));

SendClientMessage(giveplayerid, COLOR_YELLOW, string);

format(string, sizeof(string), "%s whispers: %s", sendername, (result));

SendClientMessage(playerid,  COLOR_YELLOW, string);

return 1;

}

}

else

{

format(string, sizeof(string), "  %d is not an active player.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

if(PlayerInfo[playerid][pLevel] < 4)
	        {
         		SendClientMessage(playerid, 0x4FA7FFFF, "*** You need level 4 to use this !");
	            return 1;
	        }
asta o bagi sub asta
if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
	            return 1;
	        }

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.