21.11.2011, 20:00
pawn Код:
if(strcmp(cmd, "/enviartuto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[Comando:] /enviartuto [playerid/partofname] [razгo]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new result[128];
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
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, "USE: /enviartuto [Player ID/Parte do Nick] [Razгo]");
return 1;
}
//KickLog(string);
SendClientMessage(giveplayerid,COLOR_WHITE,string);
//PlayerInfo[playerid][pTut] = 1;
InitiateTutorial(giveplayerid);
format(string, 256, "{8B008B}%s foi enviado para o tutorial por %s, Motivo: %s", giveplayer, sendername,(result));
SendClientMessageToAll(0x8B008BAA, string);
//Kick(giveplayerid);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[ERRO:] Esse player nгo estб logado.");
}
}
return 1;
}