07.05.2012, 17:03
Ola queria que quando alguem desse su aparecesse assimm la pros cop : /su th = Tentativa de homicideo Nao apenas o th ou qualker otra coisa que o cara digita no /su
Codigo /su :
Otro cod pra por
Codigo /su :
PHP код:
if(strcmp(cmd, "/suspeito", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um policial!");
return 1;
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo Bateu o cartгo!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: (/su)speito [id] [Descriзгo do Crime]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsACop(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
if(IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode dar su em Policiais!");
return 1;
}
if(giveplayerid != INVALID_PLAYER_ID)
{
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: (/su)speito [id] [Descriзгo do Crime]");
return 1;
}
SetPlayerCriminal(giveplayerid,playerid, result);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Esse jogador nгo estб conectado.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Vocк nгo й um Policial !");
}
}
return 1;
}
PHP код:
if(Player[playerid][pLeader] == TEAM_PM || Player[playerid][pLeader] == TEAM_PF || Player[playerid][pLeader] == TEAM_FA || Player[playerid][pLeader] == TEAM_PREF || Player[playerid][pLeader] == TEAM_Detran || Player[playerid][pLeader] == TEAM_BOPE || Player[playerid][pMember] == TEAM_PM || Player[playerid][pMember] == TEAM_PF || Player[playerid][pMember] == TEAM_FA || Player[playerid][pMember] == TEAM_Detran || Player[playerid][pMember] == TEAM_BOPE)
{
if(IsPlayerConnected(giveid))
{
if(giveid != INVALID_PLAYER_ID)
{
new result[128];
format(result,128,"%s", params[strlen(tmp)+1]);
if(!strlen(result))
return SendClientMessage(playerid, COLOR_GREY, "[USO] (/su)speito [id/nick] [descricгo crime]");
if(Player[giveid][pJailed] > 0 && strcmp(result,"AP",true) != 0){SendClientMessage(playerid, COLOR_RED, "[ERRO] O jogador jб estб preso!");return 1;}
if(strcmp(result,"AP", true) == 0) { result = "Ajuste de pena"; }
else if(strcmp(result,"DOP", true) == 0) { result = "Desobediкncia a ordem policial"; }
else if(strcmp(result,"TH", true) == 0) { result = "Tentativa de homicнdio"; }
else if(strcmp(result,"CA", true) == 0) { result = "Contrabando de armas"; }
else if(strcmp(result,"CD", true) == 0) { result = "Contrabando de drogas"; }
else if(strcmp(result,"RV", true) == 0) { result = "Roubo de Veнculo"; }
else if(strcmp(result,"RM", true) == 0) { result = "Rejeicгo de multa"; }
else if(strcmp(result,"RP", true) == 0) { result = "Resistencia a prisгo"; }
else if(strcmp(result,"ILR", true) == 0) { result = "Invasгo a Local Restrito"; }
else if(strcmp(result,"RMD", true) == 0) { result = "Rejeicгo a Mostrar Documentos"; }
else if(strcmp(result,"DA", true) == 0) { result = "Desacato б Autoridade"; }
else if(strcmp(result,"PIA", true) == 0) { result = "Porte Ilegal de Armas"; }
else if(strcmp(result,"CF", true) == 0) { result = "Cumplice de Fugas"; }
else if(strcmp(result,"CS", true) == 0) { result = "Cumplice de Sequestro"; }
else if(strcmp(result,"CR", true) == 0) { result = "Cumplice de Roubo"; }
else{SendClientMessage(playerid, COLOR_RED, "[ERRO] SU inexistente!");return 1;}
if(WantedPoints[giveid] == 0)
WantedPoints[giveid] += 1;
else
WantedPoints[giveid]+= 1;
SetPlayerCriminal(giveid,playerid, result);
return 1;
}
}
else
return SendClientMessage(playerid, COLOR_RED, "[ERRO] Jogador nгo encontrado.");
}
else
SendClientMessage(playerid, COLOR_RED, "[ERRO] Vocк nгo й PM / PF / FA / BOPE.");
return 1;
}