ELEGY HELP 2! - 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: ELEGY HELP 2! (
/showthread.php?tid=370171)
ELEGY HELP 2! -
necrobg3 - 19.08.2012
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.
Re: ELEGY HELP 2! -
sanplayer - 19.08.2012
Try removing putting you in the vehicle and make it slap you
Re: ELEGY HELP 2! -
IceMeteor - 19.08.2012
I just wondering, what this line for?
pawn Код:
if(vehicleid[playerid])
{
DestroyVehicle(vehicleid[playerid]);
}
if the vehicleid is 0, destroy vehicle?
Re: ELEGY HELP 2! -
avivelkayam - 19.08.2012
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;
}
Re: ELEGY HELP 2! -
Youice - 19.08.2012
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
Re: ELEGY HELP 2! -
necrobg3 - 19.08.2012
Thanks. +REP