Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Float:X,Float:Y,Float:Z;
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/eventtp", cmdtext, true, 10) == 0)
- {
- GetPlayerPos(playerid,X,Y,Z);
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Amount","What amount of players u want to tp?","OK","Cancel");
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new amount,i,tpveh;
- if(dialogid==1)
- {
- if(response)
- {
- if(strlen(inputtext) > 0)
- {
- amount=strval(inputtext);
- i = 0;
- ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Vehicles","Do you want to tp a vehicle, if a player is inside it? \n0 for yes \n1 for no.","OK","Cancel");
- }
- }
- return 1;
- }
- if(dialogid==2)
- {
- if(response)
- {
- if(strlen(inputtext) > 0)
- {
- tpveh=strval(inputtext);
- ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"ID","Enter the ID of the player u want to tp.","OK","Cancel");
- }
- }
- }
- if(dialogid==3)
- {
- if(response)
- {
- if(strlen(inputtext) > 0)
- {
- new id,idon=1;
- id = strval(inputtext);
- if(!IsPlayerConnected(id))
- {
- SendClientMessage(playerid,0xFF0000AA,"Player is not connected.");
- idon=0;
- goto ID_INPUT;
- }
- if((idon==1)&&(tpveh==0))
- {
- Y = Y + 2;
- LinkVehicleToInterior(GetPlayerVehicleID(id),GetPlayerInterior(playerid));
- SetVehicleVirtualWorld(GetPlayerVehicleID(id),GetPlayerVirtualWorld(playerid));
- SetVehiclePos(GetPlayerVehicleID(id),X,Y,Z);
- }
- if((idon==1)&&(tpveh==1))
- {
- RemovePlayerFromVehicle(id);
- SetPlayerInterior(id,GetPlayerInterior(playerid));
- SetPlayerVirtualWorld(id,GetPlayerVirtualWorld(playerid));
- Y = Y + 2;
- SetPlayerPos(id,X,Y,Z);
- i++;
- }
- ID_INPUT:
- if(i < amount)
- {
- ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"ID","Enter the ID of the player u want to tp.","OK","Cancel");
- }
- }
- return 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment