Need help SendClientMessage
#1

Hello i hop you can help me.

I will have it so the another skins get a message " You can use this command "

PHP код:
if(!strcmp(cmdtext"/opengdg2"true))
    {
        if(
GetPlayerSkin(playerid) == 285)
        if(
IsPlayerInRangeOfPoint(playerid,45.0,2178.1000977,-2254.8500977,15.9700003))
        {
            
MoveObject(GD2,2178.1000977,-2254.8500977,19.79000092.00.00.0);
            return 
1;
        }
else return 
SendClientMessage(playeridCOLOR_ORANGE"You are not near the gate");
}
    if(!
strcmp(cmdtext"/closegdg2"true))
    {
        if(
GetPlayerSkin(playerid) == 285)
        if(
IsPlayerInRangeOfPoint(playerid,45.0,2178.1000977,-2254.8500977,15.9700003))
        {
            
MoveObject(GD2,2178.1000977,-2254.8500977,15.97000032.00.00.0);
            return 
1;
        }
else return 
SendClientMessage(playeridCOLOR_ORANGE"You are not near the gate");
}
    return 
0;

Reply
#2

Try this:

pawn Код:
if(!strcmp(cmdtext, "/opengdg2", true))
    {
        if(GetPlayerSkin(playerid) == 285)
        {
            if(IsPlayerInRangeOfPoint(playerid,45.0,2178.1000977,-2254.8500977,15.9700003))
            {
                MoveObject(GD2,2178.1000977,-2254.8500977,19.7900009, 2.0, 0.0, 0.0);
                return 1;
            }
            else return SendClientMessage(playerid, COLOR_ORANGE, "You are not near the gate");
        }
        else return SendClientMessage(playerid, COLOR_ORANGE, "You can use this command.");
    }
    if(!strcmp(cmdtext, "/closegdg2", true))
    {
        if(GetPlayerSkin(playerid) == 285)
        {
            if(IsPlayerInRangeOfPoint(playerid,45.0,2178.1000977,-2254.8500977,15.9700003))
            {
                MoveObject(GD2,2178.1000977,-2254.8500977,15.9700003, 2.0, 0.0, 0.0);
                return 1;
            }
            else return SendClientMessage(playerid, COLOR_ORANGE, "You are not near the gate");
        }
        else return SendClientMessage(playerid, COLOR_ORANGE, "You can use this command.");
    }
    return 0;
}
I'm pretty sure you meant "You CAN'T use this command.", but I wasn't sure so I made it say "You can use this command."
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)