28.01.2010, 14:00
hi guys i have a little problem whit my anticheat, i want that it dont works in a special situation(my minigun dm) so i used an if function
this is the code
and
ok so if a player is in the minigun dm the anticheat works to but i dontґt know why he works. he must only works when if(minigun[playerid] == is on 0 but when a player type /minigun if(minigun[playerid] == is on 1
and his minigun weapon will be returnt
can someone help me please ?
this is the code
Код:
forward waffen(playerid);
Код:
SetTimer("waffen",500,1);
Код:
public waffen(playerid) { for (new i = 0; i < MAX_PLAYERS; i++) { if(minigun[playerid] == 0 && GetPlayerWeapon(i) == 35 || GetPlayerWeapon(i) == 36 ||GetPlayerWeapon(i) == 43||GetPlayerWeapon(i) == 44 ||GetPlayerWeapon(i) == 45 || GetPlayerWeapon(i) == 37 || GetPlayerWeapon(i) == 38 || GetPlayerWeapon(i) == 4 || GetPlayerWeapon(i) == 17 || GetPlayerWeapon(i) == 16 || GetPlayerWeapon(i) == 18 )) { RemovePlayerWeapon(i,35 || 36 || 43 || 44 || 45|| 37 || 38 || 4 || 17 || 16 || 18); } } } RemovePlayerWeapon(playerid, weaponid) { if(!IsPlayerConnected(playerid) || weaponid < 0 || weaponid > 50) return; new saveweapon[13], saveammo[13]; for(new slot = 0; slot < 13; slot++) GetPlayerWeaponData(playerid, slot, saveweapon[slot], saveammo[slot]); ResetPlayerWeapons(playerid); for(new slot; slot < 13; slot++) { if(saveweapon[slot] == weaponid || saveammo[slot] == 0) continue; GivePlayerWeapon(playerid, saveweapon[slot], saveammo[slot]); } GivePlayerWeapon(playerid, 0, 1); }
Код:
if(strcmp(cmdtext, "/minigun", true) == 0) { if(derbygodupfuck[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Du bist im Derby zum verlassen tippe /derbyex"); minigun[playerid] = 1; udm[playerid] = 1; DMZone[playerid] = 1; Act[playerid] = 0; new cmdname[MAX_PLAYER_NAME]; new string[100],string1[100]; GetPlayerName(playerid, cmdname, sizeof(cmdname)); format(string, sizeof(string), ">>> %s ist im Minigun deathmatch /udm <<<", cmdname); format(string1, sizeof(string1), ">>> %s is at Minigun deathmatch /udm <<<", cmdname); LSendClientMessageToAll(0xF100C8FF, string,string1); LSendClientMessage(playerid, COLOR_GREEN, "Um das DM zuverlassen tippe /dmex.","To leave the deathmatch type /dmex."); GivePlayerWeapon(playerid, 38, 9999999); SetPlayerInterior(playerid,0); new spawns = random(5); switch(spawns) { case 0: SetPlayerPos(playerid,1.6183,-3527.8508,47.4799); case 1: SetPlayerPos(playerid,69.0028,-3521.6167,45.4624); case 2: SetPlayerPos(playerid,0.8512,-3401.5830,45.4624); case 3: SetPlayerPos(playerid,72.4575,-3392.5244,17.0459); case 4: SetPlayerPos(playerid,23.7303,-3485.9155,29.1244); } return 1; }
Код:
new minigun[MAX_PLAYERS];
and his minigun weapon will be returnt
can someone help me please ?