Woozie 0 Odesláno: 12. Listopad, 2012 Share Odesláno: 12. Listopad, 2012 Čaute... mám problém s AFk new AFK[MAX_PLAYERS] = false;[/u] [u]if(strcmp(cmdtext, "/afk", true) == 0) { new playername[24], str[256]; if(!AFK[playerid]) { GetPlayerName(playerid, playername, 24); format(str, 256, "%s (ID: %d) odesel na chvili pryc!", playername, playerid); SendClientMessageToAll(COLOR_YELLOW, str); TogglePlayerControllable(playerid, false); AFK[playerid] = true; } if(AFK[playerid]) { GetPlayerName(playerid, playername, 24); format(str, 256, "%s (ID: %d) se vratil k PC!", playername, playerid); SendClientMessageToAll(COLOR_YELLOW, str); TogglePlayerControllable(playerid, true); AFK[playerid] = false; } return true; } no ale ked dám príkaz /afk tam sa nestane nič a hned pod to napíše že si AFK ale aj späť Dík Link to comment Share on other sites More sharing options...
0 Guest Norhy Odesláno: 12. Listopad, 2012 Share Odesláno: 12. Listopad, 2012 Facepalm.. new AFK[MAX_PLAYERS] = false;[/u] [u]if(strcmp(cmdtext, "/afk", true) == 0) { new playername[24], str[256]; if(!AFK[playerid]) { GetPlayerName(playerid, playername, 24); format(str, 256, "%s (ID: %d) odesel na chvili pryc!", playername, playerid); SendClientMessageToAll(COLOR_YELLOW, str); TogglePlayerControllable(playerid, false); AFK[playerid] = true; } else { GetPlayerName(playerid, playername, 24); format(str, 256, "%s (ID: %d) se vratil k PC!", playername, playerid); SendClientMessageToAll(COLOR_YELLOW, str); TogglePlayerControllable(playerid, true); AFK[playerid] = false; } return true; } Naco tam mas 2x if(!AFK[playerid]) mozes pouziť else.. Link to comment Share on other sites More sharing options...
0 Hrb™ 48 Odesláno: 12. Listopad, 2012 Share Odesláno: 12. Listopad, 2012 Zkus: #include <a_samp> new bool:AFK[MAX_PLAYERS]; public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/afk", true) == 0) { new playername[24], str[256]; if(AFK[playerid]== false) { GetPlayerName(playerid, playername, 24); format(str, 256, "%s (ID: %d) odesel na chvili pryc!", playername, playerid); SendClientMessageToAll(COLOR_YELLOW, str); TogglePlayerControllable(playerid, false); AFK[playerid] = true; }else{ GetPlayerName(playerid, playername, 24); format(str, 256, "%s (ID: %d) se vratil k PC!", playername, playerid); SendClientMessageToAll(COLOR_YELLOW, str); TogglePlayerControllable(playerid, true); AFK[playerid] = false; } return 1; } return 0; } Link to comment Share on other sites More sharing options...
Dotaz
Woozie 0
Čaute...
mám problém s AFk
no ale ked dám príkaz /afk tam sa nestane nič a hned pod to napíše že si AFK ale aj späť
Dík
Link to comment
Share on other sites
2 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now