toribio

toribio

Sep 11th, 2008
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. //no topo:
  2. new cp1;
  3. new cp2;
  4.  
  5. //no OnGameModeInit:
  6. cp1 = CPS_AddCheckpoint(x, y, z, 3.0, 40);
  7. cp2 = CPS_AddCheckpoint(x, y, z, 3.0, 40);
  8.  
  9. //no OnPlayerEnterCheckpoint:
  10. new checkpointid = CPS_GetPlayerCheckpoint(playerid);
  11.  
  12. if(checkpointid == cp1)
  13. {
  14.     //vc entrou on CP 1...
  15. }
  16.  
  17. if(checkpointid == cp2)
  18. {
  19.     //vc entrou no CP 2...
  20. }
  21.  
  22. //s� isso...
  23. //ai pra comando:
  24.  
  25. if(!strcmp(cmdtext, "/comando", true))
  26. {
  27.     if(CPS_IsPlayerInCehckpoint(playerid, cp1)) //s� mudar a var�vel do CP
  28.     {
  29.         //voce est� no cp1
  30.     } else {
  31.         //voc� n�o est� no cp 1, e n�o pode usar este comando
  32.     }
  33.     return 1;
  34. }
Add Comment
Please, Sign In to add comment