14.04.2019, 19:31
Quote:
Code:
CMD:pdht(playerid, params[]) { if(eingeloggt[playerid] == 0)return SendClientMessage(playerid, COLOR_RED, "Du bist noch nicht eingeloggt."); if(pInfo[playerid][fraktion] != 1 && pInfo[playerid][fraktion] != 4)return SendClientMessage(playerid, COLOR_RED, "Du bist kein Mitglied vom SFPD oder LSPD."); if(pInfo[playerid][duty] != 1)return SendClientMessage(playerid, COLOR_RED, "Du bist nicht im Dienst."); if(SWAT[playerid] == 1)return SendClientMessage(playerid, COLOR_RED, "Du kannst keine Weste anziehen wenn du SWAT bist."); if(GetPVarInt(playerid,"HutAn") == 1) { SetPVarInt(playerid, "HutAn", 0); //DestroyObject(PDHut[playerid]); RemovePlayerAttachedObject(playerid, 1); SendClientMessage(playerid, COLOR_WHITE, "Du hast den Hut abgenommen."); pdhutan[playerid] = 0; return 1; } SetPVarInt(playerid,"HutAn",1); //new Float:x,Float:y,Float:z; //GetPlayerPos(playerid,x,y,z); //PDHut[playerid] = CreateObject(19096, x,y,z, 0.0000, -90.0000, 0.0000); //CowboyHat3 SetPlayerAttachedObject(playerid, 1, 19096, 2, 0.130, 0.012, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0,0); SendClientMessage(playerid, COLOR_WHITE, "Du hast den Hut aufgesetzt."); pdhutan[playerid] = 1; return 1; } |
If you are ID 1, the first check will return false which will skip the other check, which in turn just skips over the if statement and its code block. Same idea for ID 4.