14.09.2014, 07:18
Hola a todos tengo un problema de los cargos yo se los pongo todo funciona bien se le marca en el radar el punto y el color pero yo al acercarme a el pierde el punto y el color їQue podrб ser? llevo 1 mes tratando de aregarlo y nada, necesito ayuda yo solo quiero que nunca se desaparezca el color y ni el punto en el radar.
CMD:cargos(playerid,params[])
{
new name[MAX_PLAYER_NAME];
new name2[MAX_PLAYER_NAME];
new string[150];
if(!IsACop(playerid) || Info[playerid][pDutyPolicia] != 1) return SendClientMessage(playerid, COLOR_GRAD2, "No formas parte de SAPD o no estas con el uniforme puesto.");
if(!sscanf(params,"ii", params[0], params[1]))
{
GetPlayerName(params[0], name, sizeof(name));
GetPlayerName(playerid, name2, sizeof(name2));
if(IsPlayerConnected(params[0]))
{
if(params[0] == playerid) return SendClientMessage(playerid, COLOR_GRAD2, "{F4FA58}Error: {FFFFFF}No te puedes poner cargos ati mismo.");
}
if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "Jugador desconectado.");
switch(params[1])
{
case 0:
{
Info[params[0]][pWantedLevel] = 0;
SetPlayerWantedLevel(params[0], 0);
{
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}tiene todo en orden, lo dejo continuar {F6FF00}(0)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsACop(i))
{
SetPlayerColor(params[0], c0_color);
SetPlayerMarkerForPlayer(i, params[0], c0_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 1:
{
format(string, sizeof(string), "{F6FF00}La policнa desea hablar contigo, si intentas escapar, serбs arrestado.");
SendClientMessageEx(params[0], COLOR_WHITE, string);
Info[params[0]][pWantedLevel] = 1;
SetPlayerWantedLevel(params[0], 1);
{
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}parece sospechoso, voy a interrogarlo {F6FF00}(1)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c1_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 2:
{
format(string, sizeof(string), "Te escapaste, ahora toda la policia te buscarб.");
SendClientMessageEx(params[0], COLOR_WHITE, string);
Info[params[0]][pWantedLevel] = 2;
SetPlayerWantedLevel(params[0], 2);
{
format(string, sizeof(string), "[Central] {FFFFFF}%s: %s se resistiу al arresto, procedemos a su persecuciуn {F6FF00}(2)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c2_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 3:
{
Info[params[0]][pWantedLevel] = 3;
SetPlayerWantedLevel(params[0], 3);
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}se encuentra armado, procedan con precauciуn {F6FF00}(3)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c3_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 4:
{
Info[params[0]][pWantedLevel] = 4;
SetPlayerWantedLevel(params[0], 4);
{
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}abriу fuego, necesito refuerzos {F6FF00}(4)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c4_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 5:
{
Info[params[0]][pWantedLevel] = 5;
SetPlayerWantedLevel(params[0], 5);
{
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}asesinу, detener vivo o muerto {F6FF00}(5)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c5_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 6:
{
Info[params[0]][pWantedLevel] = 6;
SetPlayerWantedLevel(params[0], 6);
{
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}es extremadamente peligroso, disparen a matar {F6FF00}(6)*", name2, name);
format(string, sizeof(string), "[Central] {FFFFFF}%s: %s es extremadamente peligroso, disparen a matar.", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c6_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
}
}
else SendClientMessage(playerid, -1, "Utiliza: /c [ID] [1-6]");
return 1;
}
Uso el SetPlayerMarkerForPlayer para que se vea el punto sirve es cuando estoy lejos del que tiene cargos. yo quiero que nunca se desparesca el color porfavor.
CMD:cargos(playerid,params[])
{
new name[MAX_PLAYER_NAME];
new name2[MAX_PLAYER_NAME];
new string[150];
if(!IsACop(playerid) || Info[playerid][pDutyPolicia] != 1) return SendClientMessage(playerid, COLOR_GRAD2, "No formas parte de SAPD o no estas con el uniforme puesto.");
if(!sscanf(params,"ii", params[0], params[1]))
{
GetPlayerName(params[0], name, sizeof(name));
GetPlayerName(playerid, name2, sizeof(name2));
if(IsPlayerConnected(params[0]))
{
if(params[0] == playerid) return SendClientMessage(playerid, COLOR_GRAD2, "{F4FA58}Error: {FFFFFF}No te puedes poner cargos ati mismo.");
}
if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "Jugador desconectado.");
switch(params[1])
{
case 0:
{
Info[params[0]][pWantedLevel] = 0;
SetPlayerWantedLevel(params[0], 0);
{
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}tiene todo en orden, lo dejo continuar {F6FF00}(0)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsACop(i))
{
SetPlayerColor(params[0], c0_color);
SetPlayerMarkerForPlayer(i, params[0], c0_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 1:
{
format(string, sizeof(string), "{F6FF00}La policнa desea hablar contigo, si intentas escapar, serбs arrestado.");
SendClientMessageEx(params[0], COLOR_WHITE, string);
Info[params[0]][pWantedLevel] = 1;
SetPlayerWantedLevel(params[0], 1);
{
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}parece sospechoso, voy a interrogarlo {F6FF00}(1)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c1_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 2:
{
format(string, sizeof(string), "Te escapaste, ahora toda la policia te buscarб.");
SendClientMessageEx(params[0], COLOR_WHITE, string);
Info[params[0]][pWantedLevel] = 2;
SetPlayerWantedLevel(params[0], 2);
{
format(string, sizeof(string), "[Central] {FFFFFF}%s: %s se resistiу al arresto, procedemos a su persecuciуn {F6FF00}(2)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c2_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 3:
{
Info[params[0]][pWantedLevel] = 3;
SetPlayerWantedLevel(params[0], 3);
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}se encuentra armado, procedan con precauciуn {F6FF00}(3)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c3_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 4:
{
Info[params[0]][pWantedLevel] = 4;
SetPlayerWantedLevel(params[0], 4);
{
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}abriу fuego, necesito refuerzos {F6FF00}(4)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c4_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 5:
{
Info[params[0]][pWantedLevel] = 5;
SetPlayerWantedLevel(params[0], 5);
{
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}asesinу, detener vivo o muerto {F6FF00}(5)*", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c5_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
case 6:
{
Info[params[0]][pWantedLevel] = 6;
SetPlayerWantedLevel(params[0], 6);
{
format(string, sizeof(string), "[Radio de policнa] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}es extremadamente peligroso, disparen a matar {F6FF00}(6)*", name2, name);
format(string, sizeof(string), "[Central] {FFFFFF}%s: %s es extremadamente peligroso, disparen a matar.", name2, name);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsACop(i))
{
SetPlayerMarkerForPlayer(i, params[0], c6_color);
PlayerPlaySound(params[0], 1084, 0.0, 0.0 , 10.0);
}}
}
}
}
else SendClientMessage(playerid, -1, "Utiliza: /c [ID] [1-6]");
return 1;
}
Uso el SetPlayerMarkerForPlayer para que se vea el punto sirve es cuando estoy lejos del que tiene cargos. yo quiero que nunca se desparesca el color porfavor.