Hallo, habe folgendes Problem. Egal ob der Spieler gespawnt ist oder nicht, die Nachricht das er nicht gespawnt ist erscheint immer.
CMD:duel(playerid, params[]) { new weapid1, weapid2; if(GetPlayerState(playerid) != PLAYER_STATE_SPAWNED) { SendClientMessage(playerid, COLOR_RED, "You need to spawn first!"); return 1; } if(Round[r_iniciando] == true) return SendClientMessage(playerid, COLOR_RED, "You can't use this command now!"); if(sscanf(params, "ii", weapid1, weapid2)) return SendClientMessage(playerid, COLOR_RED, "Use: /duel <gun id 1> <gun id 2>"); if(weapid1 < 22 || weapid1 > 34 || weapid2 < 22 || weapid2 > 34) return SendClientMessage(playerid, COLOR_RED, "Invalid weapon ID."); if(InDuel[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You're already in a duel!"); if(Duel[playerid] != 998) return SendClientMessage(playerid, COLOR_RED, "You're already in a duel!"); if(CreatedDuel[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You already created a duel, type /cancelduel to leave it."); CreatedDuel[playerid] = 1; Duel[playerid] = 999; DuelWeapons[playerid][0] = weapid1; DuelWeapons[playerid][1] = weapid2; new dQuery[144]; format(dQuery, sizeof(dQuery), "{FF0000}(DUEL) {%06x}%s {FFFFFF}has created a duel (%s and %s) type {FF0000}/acceptduel %d", GetPlayerColor(playerid) >>> 8, GetName(playerid), GetWeaponNameEx(weapid1), GetWeaponNameEx(weapid2), playerid); SendClientMessageToAll(COLOR_RED, dQuery); return 1;}
Was habe ich falsch gemacht?
Wenn der Spieler gespawned ist , dann ist sein Status auf PLAYER_STATE_ONFOOT oder PLAYER_STATE_DRIVER bzw. PLAYER_STATE_PASSENGER
Keine Ahnung wofür PLAYER_STATE_SPAWNED existiert...