23.10.2011, 23:07
Queria saber como adicionar a este comando esta funзao: /carandiru [id] [minutos] [motivo]
if(strcmp(cmd, "/carandiru",true) == 0)
{
new string[256];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Admin] < 2)
{
SendClientMessage(playerid, COLOR_RED, "Vocк nгo pode usar este comando!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USE: /carandiru [id]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USE: /carandiru [id]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Adm.Cmd: O Player %s foi para o Carandiru pelo Admin:%s.", giveplayer, sendername);
SendClientMessageToAll(COLOR_RED, string);
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid);
RemovePlayerFromVehicle(giveplayerid);
SetPlayerPos(giveplayerid, 107.2300,1920.6311,18.520;
SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Jogador indisponнvel!");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/carandiru",true) == 0)
{
new string[256];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Admin] < 2)
{
SendClientMessage(playerid, COLOR_RED, "Vocк nгo pode usar este comando!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USE: /carandiru [id]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USE: /carandiru [id]");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Adm.Cmd: O Player %s foi para o Carandiru pelo Admin:%s.", giveplayer, sendername);
SendClientMessageToAll(COLOR_RED, string);
SetPlayerInterior(playerid, 0);
ResetPlayerWeapons(playerid);
RemovePlayerFromVehicle(giveplayerid);
SetPlayerPos(giveplayerid, 107.2300,1920.6311,18.520;
SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Jogador indisponнvel!");
return 1;
}
}
return 1;
}