"Vocк nгo estб na divisгo da SWAT."
CMD:darswat(playerid,params[]) { new id; if(PlayerInfo[playerid][pDuty] == 1 && PlayerInfo[playerid][jMiembro] == 1 && PlayerInfo[playerid][pRango] == 6 || PlayerInfo[playerid][jAdminNvl] < 4) { if(!sscanf(params,"d",id)) { if(PlayerInfo[id][jMiembro] == 1) { if(PlayerInfo[id][pSwat] == 0) { SendClientMessage(id, -1, "Parabйns! O comissбrio da S.A.P.D te tornou vocк um lнder da {DBED15}SWAT{FFFFFF}!."); PlayerInfo[id][pSwat] = 1; SendClientMessage(playerid, -1, "Vocк designou a divisгo da {DBED15}SWAT{FFFFFF}!."); return 1; } else { SendClientMessage(id, -1, "Lamentavel! O comissбrio da S.A.P.D te expulsou da {DBED15}SWAT{FFFFFF}!."); PlayerInfo[id][pSwat] = 0; SendClientMessage(playerid, -1, "Vocк expulsou o jogador da {DBED15}SWAT{FFFFFF}!."); return 1; } } else return SendClientMessage(playerid, -1, "Este jogador nгo й da policia"); } else return SendClientMessage(playerid, -1, "{FFFFFF}Digite: {DBED15}/darswat [ID] [1]."); } else SendClientMessage(playerid, -1, "Vocк nгo pode usar este comando."); return 1; }
if(strcmp(texto, "swat", true) == 0) { if(PlayerInfo[playerid][pDuty] == 1 && PlayerInfo[playerid][pSwat] == 1) { if(IsPlayerInRangeOfPoint(playerid,1.0,253.2745,77.1979,1003.6406)) { if(PlayerInfo[playerid][pDuty] == 0) { PlayerInfo[playerid][pDuty] = 1; SendClientMessage(playerid, COLOR_WHITE, "Vocк colocou seu uniforme de SWAT."); RemovePlayerAttachedObject(playerid, 3); RemovePlayerAttachedObject(playerid, 4); SetPlayerSkin(playerid, 285); SetPlayerColor(playerid,COLOR_POLICIA); } else { RemovePlayerAttachedObject(playerid, 3); RemovePlayerAttachedObject(playerid, 4); SetPlayerColor(playerid,COLOR_WHITE); SendClientMessage(playerid, COLOR_WHITE, "Vocк retirou seu uniforme de SWAT."); SetPlayerSkin(playerid, PlayerInfo[playerid][jRopa]); PlayerInfo[playerid][pDuty] = 0; if(PlayerInfo[playerid][pWP1] == 3) { QuitarArma(playerid, 3); QuitarArma(playerid, 3); QuitarArma(playerid, 24); QuitarArma(playerid, 27); QuitarArma(playerid, 31); RemovePlayerAttachedObject(playerid,1); QuitarArma(playerid, 46); QuitarArma(playerid, 41); QuitarArma(playerid, 16); } ResetPlayerWeapons(playerid); DarArmas(playerid); } } } else return SendClientMessage(playerid,-1,"Vocк nгo estб na divisгo da SWAT."); } return 1; }
if(IsPlayerInRangeOfPoint
Aumente o range 1.0 para 3.0 e em seguida verifique se as coordenadas estгo certas, que no caso, as que escolheu sгo 253.2745,77.1979,1003.6406 em...
PHP код:
|
if(strcmp(texto, "swat", true) == 0) { if(PlayerInfo[playerid][pSwat] == 1) { if(IsPlayerInRangeOfPoint(playerid,2.0,253.2745,77.1979,1003.6406)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб no local adequado"); if(PlayerInfo[playerid][pDuty] == 0) { PlayerInfo[playerid][pDuty] = 1; SendClientMessage(playerid, COLOR_WHITE, "Vocк colocou seu uniforme de SWAT."); RemovePlayerAttachedObject(playerid, 3); RemovePlayerAttachedObject(playerid, 4); SetPlayerSkin(playerid, 285); SetPlayerColor(playerid,COLOR_POLICIA); } else { RemovePlayerAttachedObject(playerid, 3); RemovePlayerAttachedObject(playerid, 4); SetPlayerColor(playerid,COLOR_WHITE); SendClientMessage(playerid, COLOR_WHITE, "Vocк retirou seu uniforme de SWAT."); SetPlayerSkin(playerid, PlayerInfo[playerid][jRopa]); PlayerInfo[playerid][pDuty] = 0; if(PlayerInfo[playerid][pWP1] == 3) { QuitarArma(playerid, 3); QuitarArma(playerid, 3); QuitarArma(playerid, 24); QuitarArma(playerid, 27); QuitarArma(playerid, 31); RemovePlayerAttachedObject(playerid,1); QuitarArma(playerid, 46); QuitarArma(playerid, 41); QuitarArma(playerid, 16); } ResetPlayerWeapons(playerid); DarArmas(playerid); } } else return SendClientMessage(playerid,-1,"Vocк nгo estб na divisгo da SWAT."); } return 1; }
if(IsPlayerInRangeOfPoint(playerid,2.0,253.2745,77.1979,1003.6406)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб no local adequado");
if(IsPlayerInRangeOfPoint(playerid,2.0,253.2745,77.1979,1003.6406))
if(!IsPlayerInRangeOfPoint(playerid,2.0,253.2745,77.1979,1003.6406))
Код:
if(IsPlayerInRangeOfPoint(playerid,2.0,253.2745,77.1979,1003.6406)) Код:
if(!IsPlayerInRangeOfPoint(playerid,2.0,253.2745,77.1979,1003.6406)) |
if(!IsPlayerInRangeOfPoint(playerid,2.0,253.2745,77.1979,1003.6406)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб no local adequado");
Код:
if(!IsPlayerInRangeOfPoint(playerid,2.0,253.2745,77.1979,1003.6406)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб no local adequado"); |
if(!PlayerToPoint(2.0, playerid, 253.2745,77.1979,1003.6406)) return SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo estб no local adequado");