SA-MP Forums Archive
Someone got a script on /gotoco(ordinates)? - 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: Someone got a script on /gotoco(ordinates)? (/showthread.php?tid=496783)



Someone got a script on /gotoco(ordinates)? - JackieJ - 23.02.2014

Someone got a script on /gotoco or /gotopos i really need that?


Re: Someone got a script on /gotoco(ordinates)? - FilesMAker - 23.02.2014

I'm working with strcmp do you want it ?


Re: Someone got a script on /gotoco(ordinates)? - JackieJ - 23.02.2014

Yes please message me on pm please


Re: Someone got a script on /gotoco(ordinates)? - MattTucker - 23.02.2014

pawn Код:
CMD:gotoco(playerid, params[])
{
    new int, Float:x, Float:y, Float:z;
    // You can add your admin code here like "if(PlayerInfo[playerid][pAdmin]..."
    if(sscanf(params, "fffi", x,y,z, int)) return SendClientMessage(playerid, -1, "USAGE: /gotoco [x] [y] [z] [interior]");
    SetPlayerPos(playerid, x,y,z);
    SetPlayerInterior(playerid, int);
    return 1;
}
CMD:gotopos(playerid, params[])
{
    return cmd_gotoco(playerid, params);
}
Here you go, both will work.


Re: Someone got a script on /gotoco(ordinates)? - JackieJ - 23.02.2014

THanks so much its working fine ! ill give you +rep


Re: Someone got a script on /gotoco(ordinates)? - LocMax - 23.02.2014

Also a tip:

pawn Код:
CMD:gotoco(playerid, params[])
{
    new int, Float:x, Float:y, Float:z;
    // You can add your admin code here like "if(PlayerInfo[playerid][pAdmin]..."
    if(sscanf(params, "fffi", x,y,z, int)) return SendClientMessage(playerid, -1, "USAGE: /gotoco [x] [y] [z] [interior]");
    SetPlayerPos(playerid, x,y,z);
    SetPlayerInterior(playerid, int);
    return 1;
}
If you're gonna add admin check, add it above
new int, Float, Float:y, Float:z;

so variables aren't created uselessly if player isn't admin.

like this:
pawn Код:
CMD:gotoco(playerid, params[])
{
     if(!IsPlayerAdmin) return SendClientMessage(playerid, 0xFF0000AA, "You need to be an admin to use this command.");
    new int, Float:x, Float:y, Float:z;
    if(sscanf(params, "fffi", x,y,z, int)) return SendClientMessage(playerid, -1, "USAGE: /gotoco [x] [y] [z] [interior]");
    SetPlayerPos(playerid, x,y,z);
    SetPlayerInterior(playerid, int);
    return 1;
}



Re: Someone got a script on /gotoco(ordinates)? - JackieJ - 23.02.2014

Im tested it one time and when im tried to compile it again it gaves me errors :/.

Quote:

C:\Users\JACOLA03\Desktop\cops and robbers\gamemodes\1.1.1.pwn(8706) : error 017: undefined symbol "PlayerInfo"
C:\Users\JACOLA03\Desktop\cops and robbers\gamemodes\1.1.1.pwn(8706) : warning 215: expression has no effect
C:\Users\JACOLA03\Desktop\cops and robbers\gamemodes\1.1.1.pwn(8706) : error 001: expected token: ";", but found "]"
C:\Users\JACOLA03\Desktop\cops and robbers\gamemodes\1.1.1.pwn(8706) : error 029: invalid expression, assumed zero
C:\Users\JACOLA03\Desktop\cops and robbers\gamemodes\1.1.1.pwn(8706) : fatal error 107: too many error messages on one line

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


4 Errors.

Quote:

CMD:gotoco(playerid, params[])
{
new int, Float, Float:y, Float:z;
if(PlayerInfo[playerid][pAdmin]
if(sscanf(params, "fffi", x,y,z, int)) return SendClientMessage(playerid, -1, "USAGE: /gotoco [x] [y] [z] [interior]");
SetPlayerPos(playerid, x,y,z);
SetPlayerInterior(playerid, int);
return 1;
}




Re: Someone got a script on /gotoco(ordinates)? - LocMax - 23.02.2014

pawn Код:
CMD:gotoco(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, 0xFF0000AA, "You need to be an admin to use this command.");
    new int, Float:x, Float:y, Float:z;
    if(sscanf(params, "fffi", x,y,z, int)) return SendClientMessage(playerid, -1, "USAGE: /gotoco [x] [y] [z] [interior]");
    SetPlayerPos(playerid, x,y,z);
    SetPlayerInterior(playerid, int);
    return 1;
}



Re: Someone got a script on /gotoco(ordinates)? - JackieJ - 23.02.2014

Quote:
Originally Posted by LocMax
Посмотреть сообщение
pawn Код:
CMD:gotoco(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, 0xFF0000AA, "You need to be an admin to use this command.");
    new int, Float:x, Float:y, Float:z;
    if(sscanf(params, "fffi", x,y,z, int)) return SendClientMessage(playerid, -1, "USAGE: /gotoco [x] [y] [z] [interior]");
    SetPlayerPos(playerid, x,y,z);
    SetPlayerInterior(playerid, int);
    return 1;
}
Quote:

C:\Users\JACOLA03\Desktop\cops and robbers\gamemodes\1.1.1.pwn(8705) : error 017: undefined symbol "PlayerInfo"
C:\Users\JACOLA03\Desktop\cops and robbers\gamemodes\1.1.1.pwn(8705) : warning 215: expression has no effect
C:\Users\JACOLA03\Desktop\cops and robbers\gamemodes\1.1.1.pwn(8705) : error 001: expected token: ";", but found "]"
C:\Users\JACOLA03\Desktop\cops and robbers\gamemodes\1.1.1.pwn(8705) : error 029: invalid expression, assumed zero
C:\Users\JACOLA03\Desktop\cops and robbers\gamemodes\1.1.1.pwn(8705) : fatal error 107: too many error messages on one line

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


4 Errors.

Dosent works :/


Re: Someone got a script on /gotoco(ordinates)? - LocMax - 23.02.2014

Do you have PlayerInfo enum?

Like:

pawn Код:
enum PInfo
{
    pAdmin
}
new PlayerInfo[MAX_PLAYERS][PInfo];