help in a command
#1

Hi

i'm trying to make a command so the player can find his door's location (/mydoor)
Код:
enum pInfo
{
    ...
    ...
    ...
    pDoor1,
    pDoor2,
    pDoor3
}
new PlayerInfo[MAX_PLAYERS][pInfo];
I'm saving the Door ID in pDoor1 or pDoor 2 or pDoor3...
Код:
CMD:ddowner(playerid, params[])
{
    new door;
    ...
    ...
    ...
    ...
    PlayerInfo[playerid][pDoor1] = door;
Using this command, i can set the Door owner, and it will saves the door id in "pDoor1"
Код:
CMD:mydoor(playerid, params[])
{
    if(PlayerInfo[playerid][pDoor1] == 1)
    {
       SetPlayerCheckpoint(playerd,DDinfo[pDoor1][Ex],DDinfo[pDoor1][Ey],DDinfo[pDoor1][Ez], 3.0);
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "You don't own a door.");
    }
    return 1;
}
and this is the command, anything wrong?, the checkpoint will be placed in BlueBerry, not in the Door location..;
Reply
#2

Код:
CMD:mydoor(playerid, params[])
{
    if(PlayerInfo[playerid][pDoor1] == 1)
    {
       SetPlayerCheckpoint(playerd,DDinfo[pDoor1][Ex],DDinfo[pDoor2][Ey],DDinfo[pDoor3][Ez], 3.0);
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "You don't own a door.");
    }
    return 1;
}
Reply
#3

I think you want this
PHP код:
CMD:mydoor(playeridparams[])
{
    if(
PlayerInfo[playerid][pDoor1] == 1)
    {
       
SetPlayerCheckpoint(playerd,DDinfo[PlayerInfo[playerid][pDoor1]][Ex],DDinfo[PlayerInfo[playerid][pDoor1]][Ey],DDinfo[PlayerInfo[playerid][pDoor1]][Ez], 3.0);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_WHITE"You don't own a door.");
    }
    return 
1;

Reply
#4

Quote:
Originally Posted by javedali1211
Посмотреть сообщение
Код:
CMD:mydoor(playerid, params[])
{
    if(PlayerInfo[playerid][pDoor1] == 1)
    {
       SetPlayerCheckpoint(playerd,DDinfo[pDoor1][Ex],DDinfo[pDoor2][Ey],DDinfo[pDoor3][Ez], 3.0);
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "You don't own a door.");
    }
    return 1;
}
pDoor1 = Door1 ]
pDoor2 = Door2 ] => Player can own 3doors, like, pDoor1 = Doorid 12 | pDoor2 = Doorid 13 | pDoor3 = Doorid14
PDoor3 = Door3 ]

so the player owns 3 doors (12+13+14)
if i use your command, it won't work..
Reply
#5

Quote:
Originally Posted by Shinja
Посмотреть сообщение
I think you want this
PHP код:
CMD:mydoor(playeridparams[])
{
    if(
PlayerInfo[playerid][pDoor1] == 1)
    {
       
SetPlayerCheckpoint(playerd,DDinfo[PlayerInfo[playerid][pDoor1]][Ex],DDinfo[PlayerInfo[playerid][pDoor1]][Ey],DDinfo[PlayerInfo[playerid][pDoor1]][Ez], 3.0);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_WHITE"You don't own a door.");
    }
    return 
1;

I'll try it.
Reply
#6

Works, Thanks alot
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)