Save position ?
#1

Quote:

forward PlayerToPoint(Float:radi, playerid, Float, Float:y, Float:z);

Quote:

//Savep //Loadp
new Float:PosX[MAX_PLAYERS], Float:PosY[MAX_PLAYERS], Float:PosZ[MAX_PLAYERS], Float:PosA[MAX_PLAYERS], PosI[MAX_PLAYERS];

Quote:

if (strcmp(cmdtext, "/savep", true)==0)
{
GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
GetPlayerFacingAngle(playerid, PosA[playerid]);
SendClientMessage(playerid, COLOR_BASIC, "Positon set! Go to this possiton with /loadp,");
PosI[playerid] = (GetPlayerInterior(playerid));
PlayerPlaySound(playerid, 1137 , 0.0, 0.0, 0.0);
return 1;
}

if (strcmp(cmdtext, "/loadp", true)==0)
{
if (!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
{
return SendClientMessage(playerid, COLOR_RED, "Use /savep first!");
}
else
{
ResetPlayerWeapons(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), PosX[playerid], PosY[playerid], PosZ[playerid]);
SetVehicleZAngle(GetPlayerVehicleID(playerid), PosA[playerid]);
SetCameraBehindPlayer(playerid);
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , PosI[playerid]);
}
else
{
InCar[playerid] = false;
SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
SetPlayerFacingAngle(playerid, PosA[playerid]);
SetCameraBehindPlayer(playerid);
}
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
SetPlayerInterior(playerid, PosI[playerid]);
SendClientMessage(playerid, COLOR_BASIC, "Saved posotion loaded.");
}
return 1;
}


whats wrong ?
i 4 got errors


Quote:

C:\Users\Remulis\Desktop\Scriptinti\GM2.pwn(3017) : error 017: undefined symbol "InCar"
C:\Users\Remulis\Desktop\Scriptinti\GM2.pwn(3017) : warning 215: expression has no effect
C:\Users\Remulis\Desktop\Scriptinti\GM2.pwn(3017) : error 001: expected token: ";", but found "]"
C:\Users\Remulis\Desktop\Scriptinti\GM2.pwn(3017) : error 029: invalid expression, assumed zero
C:\Users\Remulis\Desktop\Scriptinti\GM2.pwn(3017) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Reply
#2

You copied the command from somewhere. Because if you would write it yourself you wouldn't be that dumb and miss to write an InCar callback above the GameModeInit.
Reply
#3

it's from stunt universe so you can help me ?
Reply
#4

Omg, i already told you a problem can't you read?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)