24.05.2011, 13:11
Codigo adminduty e gm duty
e nao sei se ha mais comandos a falhar ... mas eu tive a visualizar os comandos e parece estar tudo bem :S
PHP код:
if(!strcmp(cmdtext, "/gmserviзo ", true)) // By Ellis
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, " Vocк precisa fazer o login em primeiro lugar!");
return 1;
}
if(PlayerInfo[playerid][pAdmin] > 1)
{
if(AdminDuty[playerid] == 0)
{
AdminDuty[playerid] = 1;
SetPlayerArmour(playerid, 999);
SetPlayerHealth(playerid, 999);
SetPlayerColor(playerid,0xFFBE3374);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[GameMaster ID-%d] %s estб agora de seviзo", playerid, sendername);
ABroadCast(0xFFBE3374,string,1);
if(PlayerInfo[playerid][pAdmin] >= 1)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
}
else if(AdminDuty[playerid] == 1)
{
AdminDuty[playerid] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerColor(playerid,COLOR_WHITE);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[GameMaster ID-%d] %s estб agora fora de seviзo", playerid, sendername);
ABroadCast(0xFFBE3374,string,1);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, " Tu nгo йs GameMaster ");
return 1;
}
}
return 1;
}
if(!strcmp(cmdtext, "/adminserviзo ", true)) // By Ellis
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, " Vocк precisa fazer o login em primeiro lugar!");
return 1;
}
if(PlayerInfo[playerid][pAdmin] > 3)
{
if(AdminDuty[playerid] == 0)
{
AdminDuty[playerid] = 1;
SetPlayerArmour(playerid, 999);
SetPlayerHealth(playerid, 999);
SetPlayerColor(playerid,COLOR_ASKQ);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[Administrador ID-%d] %s estб agora de seviзo", playerid, sendername);
ABroadCast(COLOR_ASKQ,string,1);
if(PlayerInfo[playerid][pAdmin] >= 2)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
}
else if(AdminDuty[playerid] == 1)
{
AdminDuty[playerid] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerColor(playerid,COLOR_WHITE);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[Administrador ID-%d] %s estб agora fora de seviзo", playerid, sendername);
ABroadCast(COLOR_ASKQ,string,1);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, " Tu nгo йs admin ");
return 1;
}
}
return 0;
}
PHP код:
if (strcmp(cmd, "/estatisticasjogador", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USA: /estatisticasjogador [JogadorID/Nome]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
ShowStats(playerid,giveplayerid);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, " Nenhum jogador, tais");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, " Tu nao es administador");
}
}
return 1;
}