15.03.2012, 07:28
Hi guys,
I have just scripted two commands to save and load saved positions.
I have a slight problem with the /loadp command:
I have also put this on top of my script:
When I compile my gamemode, I get these errors:
This is the line that I get the error on:
Hope someone can help.
I have just scripted two commands to save and load saved positions.
I have a slight problem with the /loadp command:
pawn Код:
if(strcmp(cmdtext, "/loadp", true, 10) == 0)
{
if(!floatsqroot(PosX[playerid]+PosY[playerid]+PosZ[playerid]))
{
return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Please use /savep first!");
}
else
{
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_GREEN, "Saved position has been successfully loaded.");
}
return 1;
}
pawn Код:
new Float: PosX[MAX_PLAYERS], Float: PosY[MAX_PLAYERS], Float: PosZ[MAX_PLAYERS], Float: PosA[MAX_PLAYERS], PosI[MAX_PLAYERS];
Код:
error 017: undefined symbol "InCar" warning 215: expression has no effect error 001: expected token: ";", but found "]" error 029: invalid expression, assumed zero fatal error 107: too many error messages on one line
pawn Код:
InCar[playerid] = false;