Gutza201

Comanda

Aug 21st, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. CMD:an(playerid, params[])
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. new length = strlen(cmdtext);
  6. while ((idx < length) && (cmdtext[idx] <= ' '))
  7. {
  8. idx++;
  9. }
  10. new offset = idx;
  11. new result[128];
  12. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  13. {
  14. result[idx - offset] = cmdtext[idx];
  15. idx++;
  16. }
  17. result[idx - offset] = EOS;
  18. if(!strlen(result))
  19. {
  20. SendClientMessage(playerid, COLOR_GRAD2, "Use: /an [raspuns]");
  21. return 1;
  22. }
  23. if(TriviaQ == -1)
  24. {
  25. SendClientMessage(playerid, COLOR_WHITE, "Nici un event trivia disponibil");
  26. return 1;
  27. }
  28. if( strcmp(result,Raspuns[TriviaQ],true) == 0 )
  29. {
  30. SendClientMessage(playerid, COLOR_WHITE, "Raspuns Bun");
  31. TriviaQ = -1;
  32. }
  33. else
  34. {
  35. //Raspuns Gresit
  36. }
  37. }
  38. return 1;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment