31.05.2017, 04:15
Hello,
i got a problem that when every i use gate cmd it says u r not admin or owner of the gate even if i am admin plzz help me
i got a problem that when every i use gate cmd it says u r not admin or owner of the gate even if i am admin plzz help me
Код:
CMD:gate(playerid, params[]) { // Gates new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); new done; for(new idx=1; idx<MAX_GATES; idx++) { new Float:cur[3]; if(GateInfo[idx][gModel]) { GetDynamicObjectPos(GateInfo[idx][gGate], cur[0], cur[1], cur[2]); if(PlayerInfo[playerid][Level] != 8 || GateInfo[idx][gOwner] != name[playerid] ) return SendClientMessage(playerid, -1, "You aren't the owner or admin level 8"); if(IsPlayerInRangeOfPoint(playerid, 8, cur[0], cur[1], cur[2]) || IsPlayerInRangeOfPoint(playerid, 8, GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ]) || IsPlayerInRangeOfPoint(playerid, 8, GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ])) { if(strlen(GateInfo[idx][gPassword])) { if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE: /gate [password]"); if(strcmp(params, GateInfo[idx][gPassword])) return SendClientMessage(playerid, -1, "Invalid gate password."); if(!GateInfo[idx][gStatus]) { GateInfo[idx][gStatus] = 1; MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ], GateInfo[idx][gSpeed], GateInfo[idx][gORX], GateInfo[idx][gORY], GateInfo[idx][gORZ]); done=1; break; } else { GateInfo[idx][gStatus] = 0; MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gSpeed], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]); done=1; break; } } else { if(!GateInfo[idx][gStatus]) { GateInfo[idx][gStatus] = 1; MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ], GateInfo[idx][gSpeed], GateInfo[idx][gORX], GateInfo[idx][gORY], GateInfo[idx][gORZ]); done=1; break; } else { GateInfo[idx][gStatus] = 0; MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gSpeed], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]); done=1; break; } } } } } if(!done) SendClientMessage(playerid, -1, "You aren't near a gate you can open."); return 1; }