SA-MP Forums Archive
Command help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command help (/showthread.php?tid=360732)



Command help - farCry.xD - 18.07.2012

Hey I have a problem with this command :
Код:
dcmd_pizza(playerid,params[]) {
			#pragma unused params
			new vehicleid = GetPlayerVehicleID(playerid);
			new Float:X,Float:Y,Float:Z, Float:Angle;
			GetPlayerPos(playerid,X,Y,Z);
			GetPlayerFacingAngle(playerid,Angle);
			GetPlayerVehicleID(playerid);
			vehicleid = CreateVehicle(448,X,Y,Z,Angle,-1,-1,600);
			vehicleid = PutPlayerInVehicle(playerid, vehicleid, 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!");
		    if(DMZone[playerid] == 1) return SendClientMessage(playerid,COLOR_RED, "ERROR: You can't use this command in DM!");
			new State = GetPlayerState(playerid);
			if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
			{
			LinkVehicleToInterior(vehicleid, 0);
			SetPlayerInterior(playerid, 0);
			return SetVehiclePos(vehicleid, 2099.0176, -1806.1030, 13.5551);
			}
			SetPlayerPos(playerid, 2099.0176, -1806.1030, 13.5551);
			SetPlayerInterior(playerid, 0);
			return 1;
	}
This command need to put player in a car and teleport him ...
But the teleport doesn't work ..
Help


Re: Command help - Opah - 18.07.2012

pawn Код:
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;
}