01.02.2015, 21:42
Hello sa-mp.com! So order has a problem, if we id 0 and given / unfreeze area 100 and works only to go, but other player does not work .. may be the loop, I have a command / healall in using loop and give life using only the command ...
Excuse my English!
Excuse my English!
PHP код:
CMD:area(playerid, params[]) {
if(PlayerLogat[playerid] == 0) return 1; new item[20], range;
if(PlayerInfo[playerid][pAdmin] < 3 && PlayerInfo[playerid][pLanguage] == 1) return SendClientMessage(playerid, COLOR_GENERAL, "Nu esti autorizat sa folosesti aceasta comanda.");
else if(PlayerInfo[playerid][pAdmin] < 3 && PlayerInfo[playerid][pLanguage] == 2) return SendClientMessage(playerid, COLOR_GENERAL, "You are not authorized to use this command.");
if(sscanf(params, "s[20]i", item, range)) return SendClientMessage(playerid, COLOR_GREY, "Use: {FFFFFF}/area <name> <range>");
GetPlayerName(playerid, sendername, sizeof(sendername));
for(new i = 0; i < MAX_PLAYERS; i ++ && IsPlayerConnected(i)) {
if(strcmp(item, "freeze", true, strlen(item)) == 0) {
if(IsPlayerInRangeOfPoint(i, range*1000, pX, pY, pZ)) {
TogglePlayerControllable(i, 0); PlayerFreezed[i] = 1;
SendClientMessage(i, COLOR_YELLOW, "Admin %s ti-a dat freeze.", sendername); return 1; } }
else if(strcmp(item, "unfreeze", true, strlen(item)) == 0) {
if(IsPlayerInRangeOfPoint(i, range*1000, pX, pY, pZ)) {
TogglePlayerControllable(i, 1); PlayerFreezed[i] = 0;
SendClientMessage(i, COLOR_YELLOW, "Admin %s ti-a dat unfreeze.", sendername); return 1; } }
else if(strcmp(item, "fixveh", true, strlen(item)) == 0) {
if(IsPlayerInRangeOfPoint(i, range*1000, pX, pY, pZ)) {
RepairVehicle(GetPlayerVehicleID(i)), SetVehicleHealth(GetPlayerVehicleID(i), 1000.0);
SendClientMessage(i, COLOR_YELLOW, "Admin %s ti-a reparat masina.", sendername); return 1; } }
else if(strcmp(item, "disarm", true, strlen(item)) == 0) {
if(IsPlayerInRangeOfPoint(i, range*1000, pX, pY, pZ)) {
ResetPlayerWeapons(i);
SendClientMessage(i, COLOR_YELLOW, "Admin %s ti-a confiscat armele.", sendername); return 1; } } }
return 1; }