CMD:drag(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)){
SetCameraBehindPlayer(playerid);
SetPlayerFacingAngle( playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 3);
}
else
{
new veh = GetPlayerVehicleID(playerid);
SetPlayerHealth(playerid, 100);
SetVehicleZAngle(veh, 0);
SetCameraBehindPlayer(playerid);
LinkVehicleToInterior(veh, 0);
SetCameraBehindPlayer(playerid);
SetVehicleVirtualWorld(veh, 3);
PutPlayerInVehicle(playerid, veh, 0);
}
return GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Drag Area",2000,3);
}
CMD:drag(playerid, params[])
{
SetPlayerPos(playerid,drag coords);
SetPlayerVirtualWorld(playerid,0);
else
if(IsPlayerInAnyVehicle(playerid);
SetPlayerVehiclePos(playerid,drag coords inside a vehicle);
SetPlayerVirtualWorld(playerid,0);
return 1;
// To take the coords go to your drag map location and do /save in the player/vehicle spawn
}
Fixed (not tested)
pawn Код:
Let me tell you your mistakes: First you've placed no player/vehicle coords Second you were teleporting the player to VirtualWorld3(your random thing) Third your code was wrong. Fourth i fixed your code just add your player and vehicle pos |
new Random = random(sizeof(RandomSpawnDrag));
SetPlayerPos(playerid, RandomSpawnDrag[Random][0], RandomSpawnDrag[Random][1], RandomSpawnDrag[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnDrag[Random][3]);
switch and case:
That code is kinda useless because you did not used it in the /drag command.
And just add new coords in the /drag command. And if your drag map is big,go to different places and do /save [name] and use the pawn Код:
|
CMD:drag(playerid, params[])
{
if(GetPVarInt(playerid, "CMDDisabled") != 0)
{
ShowPlayerDialog(playerid, DIALOG_EVADE, DIALOG_STYLE_MSGBOX, "Leave Menu", "You must Leave first before using this command", "Leave", "Cancel");
return 1;
}
SetCameraBehindPlayer(playerid);
SetPlayerFacingAngle( playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 3);
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{6666FF}(/drag) {00CCFF}%s {6666FF}has Teleported to Drag Area",pName);
SendClientMessageToAll(0xFFFFFFFF, string);
}
else
{
if(IsPlayerInAnyVehicle(playerid);
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{6666FF}(/drag) {00CCFF}%s {6666FF}has Teleported to Drag Area",pName);
SendClientMessageToAll(0xFFFFFFFF, string);
new veh = GetPlayerVehicleID(playerid);
SetPlayerHealth(playerid, 100);
SetVehicleZAngle(veh, 0);
SetCameraBehindPlayer(playerid);
LinkVehicleToInterior(veh, 0);
SetCameraBehindPlayer(playerid);
SetVehicleVirtualWorld(veh, 3);
PutPlayerInVehicle(playerid, veh, 0);
}
pInEvent[playerid] = 1;
SetPVarInt(playerid, "CMDDisabled", 2);
new Random = random(sizeof(RandomSpawnDrag));
SetPlayerPos(playerid, RandomSpawnDrag[Random][0], RandomSpawnDrag[Random][1], RandomSpawnDrag[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnDrag[Random][3]);
DragCurrentRCP[playerid] = 1;
SetPlayerRaceCheckpoint(playerid, 0, DragRCP[0][0], DragRCP[0][1], DragRCP[0][2], DragRCP[1][0], DragRCP[1][1], DragRCP[1][2], 15);
return GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Drag Area",2000,3);
}
CMD:drag(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid)){
new veh = GetPlayerVehicleID(playerid);
SetPlayerHealth(playerid, 100);
SetVehicleZAngle(veh, 0);
SetCameraBehindPlayer(playerid);
LinkVehicleToInterior(veh, 0);
SetCameraBehindPlayer(playerid);
SetVehicleVirtualWorld(veh, 3);
PutPlayerInVehicle(playerid, veh, 0);
GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Drag Area",2000,3);
}
else
{
SetCameraBehindPlayer(playerid);
SetPlayerFacingAngle( playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 3);
}
return 1;
}
pawn Код:
|
CMD:drag(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid)){
new veh = GetPlayerVehicleID(playerid);
SetPlayerHealth(playerid, 100.00);
SetVehicleHealth(veh,1000.00);
SetVehicleZAngle(veh, 0);
LinkVehicleToInterior(veh, 0);
SetCameraBehindPlayer(playerid);
SetVehicleVirtualWorld(veh, 3);
GameTextForPlayer(playerid,"~y~Welcome to ~n~~b~Drag Area",2000,3);
return 1;
}
//Merge other also,this is for vehicle.