/garage command
#1

Guys sorry for spam this is the last one...
When I do:
Код:
CMD:garage(playerid, params[])
{
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5, -2286.9431,2284.1853,4.9731)) SetPlayerPos(playerid, 1588.7703,-1640.3796,13.1978);
        SetVehiclePos(GetPlayerVehicleID(playerid),1588.6764,-1643.0651,12.5711);
    }
    else
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 0)
	SendClientMessage(playerid, COLOR_RED, "You are not in the PD, Therefore cannot enter the garage.");
    return 1;
}
It will take the player and the vehicle.

So I decided to make another command /egarage:
Код:
CMD:egarage(playerid, params[])
{
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5, 1588.4303,-1640.3314,13.1932)) SetPlayerPos(playerid, -2286.1479,2280.2766,4.9684);
        SetVehiclePos(GetPlayerVehicleID(playerid),-2286.1479,2280.2766,4.9684);
    }
    else
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 0)
	SendClientMessage(playerid, COLOR_RED, "You are not in the PD, Therefore cannot enter the garage.");
    return 1;
}
If that command is in then it will just spawn you and no vehicle. HELP
Reply
#2

If you just want to teleport the player, then remove this

PHP код:
SetVehiclePos(GetPlayerVehicleID(playerid),-2286.1479,2280.2766,4.9684); 
And replace it with

PHP код:
SetPlayerPos(playerid, -2286.1479.02280.27664.9684); 
Reply
#3

I want them AND the vehicle.
Reply
#4

PHP код:
new tmpcar GetPlayerVehicleID(playerid);
CMD:egarage(playeridparams[])
{
    if(
groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1)
    {
        if(
IsPlayerInRangeOfPoint(playerid51588.4303,-1640.3314,13.1932)) SetPlayerPos(playerid, -2286.1479,2280.2766,4.9684);
        
SetVehiclePos(tmpcar,-2286.1479,2280.2766,4.9684);
    }
    else
    {
    
SendClientMessage(playeridCOLOR_RED"You are not in the PD, Therefore cannot enter the garage.");
    }
}
    return 
1;

Try this.
Reply
#5

my Pawno freezes -.-.
Reply
#6

pawn Код:
CMD:egarage(playerid, params[])
{
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5, 1588.4303,-1640.3314,13.1932))
        {
            SetVehiclePos(GetPlayerVehicleID(playerid),-2286.1479,2280.2766,4.9684);
            SetPlayerPos(playerid, -2286.1479,2280.2766,4.9684);
        }
    }
    else SendClientMessage(playerid, COLOR_RED, "You are not in the PD, Therefore cannot enter the garage.");
    return 1;
}
Reply
#7

still spawns with no car.

EDIT: you spawn ontop of the car.
Reply
#8

Wow, I never saw SetPlayerPos

PHP код:
new tmpcar GetPlayerVehicleID(playerid); 
CMD:egarage(playeridparams[]) 

    if(
groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1
    { 
        if(
IsPlayerInRangeOfPoint(playerid51588.4303,-1640.3314,13.1932))
        {
         
SetPlayerPos(playerid, -2286.1479,2280.2766,4.9684); 
         
SetVehiclePos(tmpcar,-2286.1479,2280.2766,4.9684);
         }
    }  
       else 
SendClientMessage(playeridCOLOR_RED"You are not in the PD, Therefore cannot enter the garage."); 
        } 

    return 
1

Reply
#9

weird i cant see why this is happening...
pawn Код:
CMD:egarage(playerid, params[])
{
    new veh = GetPlayerVehicleID(playerid);
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5, 1588.4303,-1640.3314,13.1932))
        {
            SetPlayerPos(playerid, -2286.1479,2280.2766,4.9684);
            SetVehiclePos(veh,-2286.1479,2280.2766,4.9684);
        }
    }
    else SendClientMessage(playerid, COLOR_RED, "You are not in the PD, Therefore cannot enter the garage.");
    return 1;
}
Reply
#10

Pawno Freeze's again, and sometimes you spawn with the car, sometimes you dont.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)