Problem Found
#1

I try to add this FS and i've alot of problems , whats wrong ?


Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/bikes", true))
{
SetPlayerPos(playerid, 1535.4368,-886.3170,61.4799);
return 1;

if(strcmp(cmdtext, "/s", true) == 0)
}
SendClientMessage(playerid, COLOR_GREEN, "Your current position was saved! To teleport back here type /l!");
if(IsPlayerInAnyVehicle(playerid))
{
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
GetVehiclePos(VehicleID, posx[playerid], posy[playerid], posz[playerid]);
GetVehicleZAngle(VehicleID, zangle[playerid]);
}
else
{
GetPlayerPos(playerid, posx[playerid], posy[playerid], posz[playerid]);
GetPlayerFacingAngle(playerid, zangle[playerid]);

Not The /bikes one, The /s one..



Thanks
Reply
#2

you closed the bracket of /bike in /s
Reply
#3

and , how i can solve this problem?
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(!strcmp(cmdtext, "/bikes", true)) {
    SetPlayerPos(playerid, 1535.4368,-886.3170,61.4799);
    return 1;
  }
  if(strcmp(cmdtext, "/s", true) == 0) {
    SendClientMessage(playerid, COLOR_GREEN, "Your current position was saved! To teleport back here type /l!");
    if(IsPlayerInAnyVehicle(playerid)) {
      new VehicleID;
      VehicleID = GetPlayerVehicleID(playerid);
      GetVehiclePos(VehicleID, posx[playerid], posy[playerid], posz[playerid]);
      GetVehicleZAngle(VehicleID, zangle[playerid]);
    }
    else {
      GetPlayerPos(playerid, posx[playerid], posy[playerid], posz[playerid]);
      GetPlayerFacingAngle(playerid, zangle[playerid]);
    }
    return 1;
  }
Reply
#5

still Have errors :

Quote:

C:\Program Files\Rockstar Games\GTA San Andreas\Scripts\gamemodes\WorldOfStunts.pwn(103) : error 017: undefined symbol "COLOR_GREEN"
C:\Program Files\Rockstar Games\GTA San Andreas\Scripts\gamemodes\WorldOfStunts.pwn(107) : error 017: undefined symbol "posx"
C:\Program Files\Rockstar Games\GTA San Andreas\Scripts\gamemodes\WorldOfStunts.pwn(107) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA San Andreas\Scripts\gamemodes\WorldOfStunts.pwn(107) : error 001: expected token: ";", but found "]"
C:\Program Files\Rockstar Games\GTA San Andreas\Scripts\gamemodes\WorldOfStunts.pwn(107) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\Scripts\gamemodes\WorldOfStunts.pwn(107) : fatal error 107: too many error messages on one line

Reply
#6

EDIT USE THIS:

ON TOP OF THE SCRIPT UNDER INCLUDES:
pawn Код:
enum SavePosENUM { Float:sX, Float:sY, Float:sZ, Float:sA, SavedPos };
new SavePos[MAX_PLAYERS][SavePosENUM];
OnPlayerCommandText:
pawn Код:
if(!strcmp(cmdtext, "/lp",true) || !strcmp(cmdtext,"/lpos",true))
        {
    if (SavePos[playerid][SavedPos] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: Use /spos to save a position 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, COLOR_WHITE, "You have teleported to the last position you have saved.");
        }
pawn Код:
if(!strcmp(cmdtext, "/spos",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, COLOR_WHITE, "Position saved.Use /lpos to go to the saved pos");
        }
Reply
#7

i guess , you're closer , i have 3x More Problems to be solved


Quote:

C:\Program Files\Rockstar Games\GTA San Andreas\Scripts\gamemodes\WorldOfStunts.pwn(9 : error 017: undefined symbol "COLOR_GREEN"
C:\Program Files\Rockstar Games\GTA San Andreas\Scripts\gamemodes\WorldOfStunts.pwn(112) : error 017: undefined symbol "x"
C:\Program Files\Rockstar Games\GTA San Andreas\Scripts\gamemodes\WorldOfStunts.pwn(113) : error 017: undefined symbol "za"
C:\Program Files\Rockstar Games\GTA San Andreas\Scripts\gamemodes\WorldOfStunts.pwn(11 : warning 209: function "OnPlayerCommandText" should return a value

Thanks for helping
Reply
#8

pawn Код:
#define COLOR_GREEN 0x00FF00AA
under includes on top of your script.

and can you post the following lines here?:
112 113
Reply
#9

Quote:

GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, za);

Lines 112 - 113


I added

Quote:

#include <a_samp>

#define COLOR_GREEN 0x00FF00AA

public OnFilterScriptInit()
{

Now i have more problems
Reply
#10

remove lines 112-113 + which problems you get?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)