Goto command with sscanf, zcmd
#1

Hey can anyones tell me how to create /goto command with sscanf and zcmd?
Reply
#2

You need these things.
Sscanf2
Zcmd

lol here's cmd i've created for u.
pawn Code:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

command(goto, playerid, params[])
{
    new ID;
    if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xF97804FF, "USAGE: /goto [id]");
    else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, 0xF97804FF, "Player is not connected!");
    else
    {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(ID, x, y, z);
    SetPlayerPos(playerid, x+1, y+1, z);
    }
    return 1;
}
Wiki Fast Commands with sscanf
Reply
#3

Thnx you are the best.
Reply
#4

Quote:
Originally Posted by hyperz
View Post
Thnx you are the best.
Lol, You're welcome mate.
Reply
#5

C:\Users\maxime\Desktop\cmdclan.pwn(97) : error 017: undefined symbol "command"
C:\Users\maxime\Desktop\cmdclan.pwn(97) : error 029: invalid expression, assumed zero
C:\Users\maxime\Desktop\cmdclan.pwn(100) : error 017: undefined symbol "params"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#6

Quote:
Originally Posted by timaoux
View Post
C:\Users\maxime\Desktop\cmdclan.pwn(97) : error 017: undefined symbol "command"
C:\Users\maxime\Desktop\cmdclan.pwn(97) : error 029: invalid expression, assumed zero
C:\Users\maxime\Desktop\cmdclan.pwn(100) : error 017: undefined symbol "params"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
PHP Code:
CMD:goto(playeridparams[])
{
     if(
IsPlayerAdmin(playerid))
     {
        new 
ID;
        new 
Str[64];
        if(
sscanf(params"u"ID)) SendClientMessage(playeridCOLOR_GREY"USAGE: /goto [playerid]");
        else if(
IsPlayerConnected(ID) == 0SendClientMessage(playeridCOLOR_GREY"Player is not connected!");
        else
        {
            new 
Float:xFloat:yFloat:z;
            
GetPlayerPos(IDxyz);
            
SetPlayerPos(playeridx+1y+1z);
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GREY"You are not authorized to use that command!");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)