Ok I got it working for all my commands except for my /s (save) and /l one. When I use the code stated above me I get errors meaning I'm missing a bracket or something. I've tried and with no success. If anyone can point me in the right direciton that would be great. Thank you.
pawn Код:
if(!strcmp(cmdtext, "/s",true) || !strcmp(cmdtext,"/sp",true)){ if (IsPlayerInAnyVehicle(playerid))
{
GetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
GetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][sA]);
}else {
GetPlayerPos(playerid, SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
GetPlayerFacingAngle(playerid, SavePos[playerid][sA]);
}SavePos[playerid][SavedPos] = 1;
return SendClientMessage(playerid, 0xFFFFFFAA, "Position saved! Use /l To Return");
}
if(!strcmp(cmdtext, "/l",true) || !strcmp(cmdtext,"/lp",true))
{
if (SavePos[playerid][SavedPos] == 0) return SendClientMessage(playerid, 0xFFFFFFAA, "Position Not Saved! Use /s First!");
if (IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
SetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][sA]);
} else {
SetPlayerPos(playerid, SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]);
SetPlayerFacingAngle(playerid, SavePos[playerid][sA]);
}
return SendClientMessage(playerid, 0xFFFFFFAA, "You have teleported to the last position you have saved.");
}