SA-MP Forums Archive
Float goto - 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: Float goto (/showthread.php?tid=316266)



Float goto - Tanush123 - 06.02.2012

I made a float goto so i selected

Float X: 316.524993
Float Y:-167.706985
Float Z: 999.593750
Interior: 6

I attempted to teleport to ammunation 5 from this link

http://weedarr.wikidot.com/interior

Well when i teleport, next thing i know i get the screen crash where my screen slowly goes white and says You cannot go pass the boundary or w/e
pawn Код:
CMD:fgoto(playerid,params[])
{
    if(PlayerData[playerid][AdminLevel] < 4) return 0;
    new pickx,picky,pickz,pickint;
    if(sscanf(params,"fffi",pickx,picky,pickz,pickint))return SCM(playerid,grey,"USAGE: /fgoto [X] [Y] [Z] [Interior]");
    format(str,sizeof(str),"You have teleported (X: %f,Y: %f,Z: %f,Interior: %d",pickx,picky,pickz,pickint);
    SCM(playerid,COLOR_LIMEGREEN,str);
    SetPlayerInterior(playerid,pickint);
    SetPlayerPos(playerid,pickx,picky,pickz);
    return 1;
}
Whatever i typed on /fgoto shows correct in the sentences
"You have teleported...."
then my screen goes white slowly, how can i fix this


Re: Float goto - suhrab_mujeeb - 06.02.2012

Do you have world boundaries in your script?


Re: Float goto - Lorenc_ - 06.02.2012

Invalid Co-ordinate, simple reaction.


Re: Float goto - iPLEOMAX - 06.02.2012

Why no "Float:" tags?

pawn Код:
new Float:pickx, Float:picky, Float:pickz, pickint;
An edit:
pawn Код:
CMD:fgoto(playerid, params[])
{
    if(PlayerData[playerid][AdminLevel] < 4) return false;
   
    new
        Float:TargetX,
        Float:TargetY,
        Float:TargetZ,
        TargetInterior
    ;
   
    if(sscanf(params, "fffi", TargetX, TargetY, TargetZ, TargetInterior))
    return SendClientMessage(playerid, grey, "USAGE: /fgoto [X] [Y] [Z] [Interior]");
   
    format(str,sizeof(str), "You have teleported (X: %f,Y: %f, Z: %f, Interior: %d",
    TargetX, TargetY, TargetZ, TargetInterior);
    SendClientMessage(playerid, COLOR_LIMEGREEN, str);
   
    SetPlayerInterior(playerid, TargetInterior);
    SetPlayerPos(playerid, TargetX, TargetY, TargetZ);
   
    return true;
}