Advertisement
Guest User

Edited

a guest
Oct 5th, 2014
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.34 KB | None | 0 0
  1. //oben im Script
  2. #define DIALOG_SUPMOBIL
  3.  
  4. new Supmobil [MAX_PLAYER_NAME];
  5.  
  6. //OnPlayerDisconnect
  7. //unter OnPlayerDisconnect
  8. if(supmobil[playerid]) DestroyVehicle(supmobil[playerid]),supmobil[playerid]=0;
  9.  
  10. //bei den anderen ocmd's
  11.  
  12. ocmd:supmobil(playerid)
  13. {
  14.     if(supmobil[playerid])
  15.     {
  16.         DestroyVehicle(supmobil[playerid]);
  17.         supmobil[playerid]=0;
  18.         SendClientMessage(playerid,ROT,"Dein Supmobil wurde erfolgreich gelöscht");
  19.         return 1;
  20.     }
  21.     if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,ROT,"Du musst zu Fuß unterwegs sein!");
  22.     return ShowPlayerDialog(playerid,DIALOG_SUPMOBIL,DIALOG_STYLE_LIST,"Supmobil","Sultan\nCheetah\nSandking","Wählen","Abbruch");
  23. }
  24. //OnDialogRespons
  25. if(dialogid==DIALOG_SUPMOBIL)
  26. {
  27.     if(!response)return 1;
  28.     new Float:p[4];
  29.     GetPlayerPos(playerid,p[0],p[1],p[2]),GetPlayerFacingAngle(playerid,p[3]);
  30.     switch(listitem) {
  31.         case 0: supmobil[playerid] = CreateVehicle(650,p[0],p[1],p[2],p[3],100,100,-1);
  32.         case 1: supmobil[playerid] = CreateVehicle(415,p[0],p[1],p[2],p[3],100,100,-1);
  33.         case 2: supmobil[playerid] = CreateVehicle(495,p[0],p[1],p[2],p[3],100,100,-1);
  34.     }
  35.     SendClientMessage(playerid,ROT,"Du hast dir ein Supmobil gespawnt!");
  36.     return PutPlayerInVehicle(playerid,supmobil[playerid],0);
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement