How to make goto and get commands ?
#1

Hello

I need to know how to make goto and get commands if i am /rcon login [PASSWORD] I mean admin

Thanks
Reply
#2

pawn Код:
CMD:goto(playerid, params[])
{
    new playerb;
    if(IsPlayerAdmin(playerid))  return SendClientMessage(playerid, 0xFF0000FF, "Your Not a Admin!");
    if(sscanf(params, "u", playerb)) SendClientMessage(playerid, 0xFF0000FF, "USAGE: /goto [playerid]");
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerb, x, y, z);
    SetPlayerPos(playerid, x+1, y+1, z);
    return 1;
}
pawn Код:
CMD:get(playerid, params[])
{
    new playerb;
    if(IsPlayerAdmin(playerid))  return SendClientMessage(playerid, 0xFF0000FF, "Your Not a Admin!");
    if(sscanf(params, "u", playerb)) SendClientMessage(playerid, 0xFF0000FF, "USAGE: /gethere [playerid]");
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerb, x+1, y+1, z);
    return 1;
}
Reply
#3

Add this to the top of your script.
PHP код:
#include <zcmd> 
And download this: https://sampforum.blast.hk/showthread.php?tid=91354

Commands:
PHP код:
CMD:get(playerid,params[])
{
    if(
IsPlayerAdmin(playerid))
    {
        new 
id;
        new 
Float:xFloat:yFloat:z;
        if (!
strlen(params)) return SendClientMessage(playerid0xFF0000FF"Usage: /get [id]");
        
id strval(params);
        if (!
IsPlayerConnected(id))SendClientMessage(playerid0xFF0000FF"Player not found.");
        
GetPlayerPos(playeridxyz);
        
SetPlayerPos(idxyz);
    }
    else
    {
        
SendClientMessage(playerid0xFF0000FF"You need to be an admin to use this.");
    }
    return 
1;

PHP код:
CMD:goto(playeridparams[])
{
    if(
IsPlayerAdmin(playerid))
    {
        new 
id;
        new 
Float:xFloat:yFloat:z;
        if (!
strlen(params)) return SendClientMessage(playerid0xFF0000FF"Usage: /goto [id]");
        
id strval(params);
        if (!
IsPlayerConnected(id))SendClientMessage(playerid0xFF0000FF"Player not found.");
        
GetPlayerPos(idxyz);
        
SetPlayerPos(playeridxyz);
    }
    else
    {
        
SendClientMessage(playerid0xFF0000FF"You need to be an admin to use this.");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)