Someone got a script on /gotoco(ordinates)?
#1

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

I'm working with strcmp do you want it ?
Reply
#3

Yes please message me on pm please
Reply
#4

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.
Reply
#5

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

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;
}
Reply
#7

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;
}

Reply
#8

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;
}
Reply
#9

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 :/
Reply
#10

Do you have PlayerInfo enum?

Like:

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


Forum Jump:


Users browsing this thread: 1 Guest(s)