PDA

View Full Version : Pizza command


farCry.xD
19/07/2012, 08:54 AM
Hey , I make a pizza boy job.. But I have some problems with command : new State;
dcmd_pizza(playerid,params[])
{
#pragma unused params
if(DMZone[playerid] == 1) return SendClientMessage(playerid,COLOR_RED, "ERROR: You can't use this command in DM!");
if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
LinkVehicleToInterior(vehicleid, 0);
RemovePlayerFromVehicle(playerid);
SetVehiclePos(vehicleid, 2099.0176, -1806.1030, 13.5551);
}
SetPlayerPos(playerid, 2099.0176, -1806.1030, 13.5551);
SetPlayerInterior(playerid, 0);
new Float:X,Float:Y,Float:Z, Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
new pizzabike = CreateVehicle(448,X,Y,Z,Angle,-1,-1,600);
PutPlayerInVehicle(playerid, pizzabike, 0);
PizzaJob[playerid] = 1;
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* %s is now a Pizzaboy.", name );
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerCheckpoint(playerid,2012.6134,-1729.3796,13.1536,10);
SendClientMessage(playerid,COLOR_YELLOW,"* Follow the red markers and you'll recieve money!");
State = GetPlayerState(playerid);
return 1;
}

This command need's to put player in a vehicle and teleport him ..
But the teleport doesn't work
Thx :|

XStormiest
19/07/2012, 09:01 AM
new State;
dcmd_pizza(playerid,params[])
{
#pragma unused params
State = GetPlayerState(playerid);
if(DMZone[playerid] == 1) return SendClientMessage(playerid,COLOR_RED, "ERROR: You can't use this command in DM!");
if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
LinkVehicleToInterior(vehicleid, 0);
RemovePlayerFromVehicle(playerid);
SetVehiclePos(vehicleid, 2099.0176, -1806.1030, 13.5551);
}
SetPlayerPos(playerid, 2099.0176, -1806.1030, 13.5551);
SetPlayerInterior(playerid, 0);
new Float:X,Float:Y,Float:Z, Float:Angle;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
new pizzabike = CreateVehicle(448,X,Y,Z+5,Angle,-1,-1,600);
LinkVehicleToInterior(playerid,pizzabike,0);
PutPlayerInVehicle(playerid, pizzabike, 0);
PizzaJob[playerid] = 1;
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* %s is now a Pizzaboy.", name );
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerCheckpoint(playerid,2012.6134,-1729.3796,13.1536,10);
SendClientMessage(playerid,COLOR_YELLOW,"* Follow the red markers and you'll recieve money!");
return 1;
}

try this script

farCry.xD
19/07/2012, 09:06 AM
The same problem :|

XStormiest
19/07/2012, 09:10 AM
so puting him in vehicle work? but teleport not? hmmm. you tried to teleport and with facing angle, to se and the facing angle?
SetPlayerFacingAngle(playerid,Angle) // replace Angle with your angle position

[MM]RoXoR[FS]
19/07/2012, 09:28 AM
WORKING

new State;
State = GetPlayerState(playerid);
if(DMZone[playerid] == 1) return SendClientMessage(playerid,COLOR_RED, "ERROR: You can't use this command in DM!");
if(IsPlayerInAnyVehicle(playerid))
{
if(State == PLAYER_STATE_DRIVER)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
LinkVehicleToInterior(vehicleid, 0);
RemovePlayerFromVehicle(playerid);
SetVehiclePos(vehicleid, 2099.0176, -1806.1030, 13.5551);
}
}
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2099.0176, -1806.1030, 13.5551);
SetPlayerFacingAngle(playerid,92.4209);

new pizzabike = CreateVehicle(448,2099.0176, -1806.1030, 13.5551,92.4209,-1,-1,600);
PutPlayerInVehicle(playerid, pizzabike, 0);
PizzaJob[playerid] = 1;
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "* %s is now a Pizzaboy.", name );
SendClientMessageToAll(COLOR_YELLOW, string);
SetPlayerCheckpoint(playerid,2012.6134,-1729.3796,13.1536,10);
SendClientMessage(playerid,COLOR_YELLOW,"* Follow the red markers and you'll recieve money!");
return 1;

The problem was that GetPlayerPos was showing you the old coordinates on player.
So, you needed to create the vehicle by typing the coordinates.

farCry.xD
19/07/2012, 10:52 AM
Thank's alot man . You are awesome ! :X