Advertisement
BratokHR

Untitled

Jan 7th, 2021
849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. // gsc.cpp
  2. {"setping", gsc_player_setping, 0},
  3.  
  4. // gsc_player.cpp
  5. void gsc_player_setping(scr_entref_t id)
  6. {
  7.     int ping;
  8.  
  9.     if ( ! stackGetParams("i", &ping))
  10.     {
  11.         stackError("gsc_player_setping() argument is undefined or has a wrong type");
  12.         stackPushUndefined();
  13.         return;
  14.     }
  15.  
  16.     if (id >= MAX_CLIENTS)
  17.     {
  18.         stackError("gsc_player_setping() entity %i is not a player", id);
  19.         stackPushUndefined();
  20.         return;
  21.     }
  22.  
  23.     client_t *client = &svs.clients[id];
  24.  
  25.     client->ping = ping;
  26.     stackPushBool(qtrue);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement