/garage command -
Jordiee - 24.11.2011
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
Re: /garage command -
=WoR=G4M3Ov3r - 24.11.2011
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.0, 2280.2766, 4.9684);
Re: /garage command -
Jordiee - 24.11.2011
I want them AND the vehicle.
Re: /garage command -
=WoR=G4M3Ov3r - 24.11.2011
PHP код:
new tmpcar = GetPlayerVehicleID(playerid);
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(tmpcar,-2286.1479,2280.2766,4.9684);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not in the PD, Therefore cannot enter the garage.");
}
}
return 1;
}
Try this.
Re: /garage command -
Jordiee - 24.11.2011
my Pawno freezes -.-.
Re: /garage command -
Pharrel - 24.11.2011
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;
}
Re: /garage command -
Jordiee - 24.11.2011
still spawns with no car.
EDIT: you spawn ontop of the car.
Re: /garage command -
=WoR=G4M3Ov3r - 24.11.2011
Wow, I never saw SetPlayerPos
PHP код:
new tmpcar = GetPlayerVehicleID(playerid);
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(tmpcar,-2286.1479,2280.2766,4.9684);
}
}
else SendClientMessage(playerid, COLOR_RED, "You are not in the PD, Therefore cannot enter the garage.");
}
}
return 1;
}
Re: /garage command -
Pharrel - 24.11.2011
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;
}
Re: /garage command -
Jordiee - 24.11.2011
Pawno Freeze's again, and sometimes you spawn with the car, sometimes you dont.