ELEGY HELP 2!
#1

Guys i don't know what's going on.
The command is ok, everything is ok.
When i type /elegy it spawns me under the map and i get frozen.
Here is the command.

pawn Код:
if (strcmp("/elegy", cmdtext, true, 10) == 0)
    {
    new Float: X, Float: Y, Float: Z, Float: A;
    new vehicleid[MAX_PLAYERS];
    if(IsPlayerInAnyVehicle(playerid))  return SendClientMessage(playerid, COLOR_RED, "ERROR: You are driving a vehicle.");
    if(vehicleid[playerid])
    {
        DestroyVehicle(vehicleid[playerid]);
    }
    vehicleid[playerid] = CreateVehicle(562, X, Y, Z, A, 0, 0, 0);
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    PutPlayerInVehicle(playerid, vehicleid[playerid], 0);
    return 1;
    }
+REP for the dude who help me.
Reply
#2

Try removing putting you in the vehicle and make it slap you
Reply
#3

I just wondering, what this line for?
pawn Код:
if(vehicleid[playerid])
    {
        DestroyVehicle(vehicleid[playerid]);
    }
if the vehicleid is 0, destroy vehicle?
Reply
#4

look what you did


you Create the vehicle in X, Y, Z before you restored it
please try this:


Код:
if (strcmp("/elegy", cmdtext, true, 10) == 0)
    {
    new Float: X, Float: Y, Float: Z, Float: A;
    new vehicleid[MAX_PLAYERS];
    if(IsPlayerInAnyVehicle(playerid))  return SendClientMessage(playerid, COLOR_RED, "ERROR: You are driving a vehicle.");
    if(vehicleid[playerid])
    {
        DestroyVehicle(vehicleid[playerid]);
    }
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    vehicleid[playerid] = CreateVehicle(562, X, Y, Z, A, 0, 0, 0);
    PutPlayerInVehicle(playerid, vehicleid[playerid], 0);
    return 1;
    }
Reply
#5

pawn Код:
GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    vehicleid[playerid] = CreateVehicle(562, X, Y+3, Z, A, 0, 0, 0);
    PutPlayerInVehicle(playerid, vehicleid[playerid], 0);
try this, I think this will respawn the vehcile infront of the player not on/under him
Reply
#6

Thanks. +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)