Problem Fast[Rep]
#1

how can i create an cmd like this i type /dmv [playerid/id] and the person goes to Dmv.get it?please helpFast!Rep
Reply
#2

what dmd stand for?
More information needed
Reply
#3

or /cityhall [playerid/id] get it and it sends the player at cityhall..
Reply
#4

So its teleporting? Give some coords, and il make it for u. (The location where u want to get teleported)
Reply
#5

1221.1116,-1814.8745,16.5938 coords like /cityhall playerid then i sends him to this coords.
Reply
#6

Quote:
Originally Posted by Dan_Barocu
Посмотреть сообщение
1221.1116,-1814.8745,16.5938 coords like /cityhall playerid then i sends him to this coords.
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/cityhall",true))
    {            
        SetPlayerPos(playerid,1221.1116,-1814.8745,16.5938);
        return 1;
    }
    return 0;
}
Reply
#7

Quote:
Originally Posted by ArmyOps
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/cityhall",true))
    {            
        SetPlayerPos(playerid,1221.1116,-1814.8745,16.5938);
        return 1;
    }
    return 0;
}
so what happens if i type /cityhall [playerid/id]
and it send an player at the coords get it now??
Reply
#8

anyone help please..
Reply
#9

Quote:
Originally Posted by ArmyOps
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/cityhall",true))
    {            
        SetPlayerPos(playerid,1221.1116,-1814.8745,16.5938);
        return 1;
    }
    return 0;
}
This is wrong. He wants to send a targetid to the cityhall. Not himself.

This is using ZCMD and sscanf. You should use it. It is fast, easy, and much more practical than using a string comparer as a command processor.

pawn Код:
CMD:cityhall(playerid,params[])
{
    new targetid;
    if(!IsPlayerAdmin(playerid)) //This is an Admin-Only command.
    {
        return SendClientMessage(playerid,0xFFFFFFFF,"  You are not authorized to use that command.");
    }
    if(sscanf(params,"i",targetid))
    {
        return SendClientMessage(playerid,0xFFFFFFFF,"USAGE: /cityhall [playerid]");
    }
    if(i == INVALID_PLAYER_ID)
    {
        return SendClientMessage(playerid,0xFFFFFFFF,"Player not found.");
    }
    else
    {
        new Admin[24],string[50];
        GetPlayerName(playerid,Admin,sizeof(Admin));
        format(string,sizeof(string),"Administrator %s has teleported you to City Hall.");
        SendClientMessage(targetid,0xFFFFFFFF,string);
        SetPlayerPos(targetid,1221.1116,-1814.8745,16.5938);
        return 1;
    }
    return 1;
}
Go check out those ZCMD and sscanf tutorials man.
Reply
#10

Quote:
Originally Posted by Walsh
Посмотреть сообщение
This is wrong. He wants to send a targetid to the cityhall. Not himself.

This is using ZCMD and sscanf. You should use it. It is fast, easy, and much more practical than using a string comparer as a command processor.

pawn Код:
CMD:cityhall(playerid,params[])
{
    new targetid;
    if(!IsPlayerAdmin(playerid)) //This is an Admin-Only command.
    {
        return SendClientMessage(playerid,0xFFFFFFFF,"  You are not authorized to use that command.");
    }
    if(sscanf(params,"i",targetid))
    {
        return SendClientMessage(playerid,0xFFFFFFFF,"USAGE: /cityhall [playerid]");
    }
    if(i == INVALID_PLAYER_ID)
    {
        return SendClientMessage(playerid,0xFFFFFFFF,"Player not found.");
    }
    else
    {
        new Admin[24],string[50];
        GetPlayerName(playerid,Admin,sizeof(Admin));
        format(string,sizeof(string),"Administrator %s has teleported you to City Hall.");
        SendClientMessage(targetid,0xFFFFFFFF,string);
        SetPlayerPos(targetid,1221.1116,-1814.8745,16.5938);
        return 1;
    }
    return 1;
}
Go check out those ZCMD and sscanf tutorials man.
Can i make it in

PHP код:
if(strcmp(cmd"/cityhall"true) == 0
??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)