Command
#1

Hello. Can someone tell me how to make a command that have 2 functions? I need command /vg. When you type /vg you turn on or off vehicle god can you tell me how do you make it? So like when you type /vg first time you turn on, second time you turn off etc.
Reply
#2

new VehicleGod[MAX_PLAYERS]; // on top of gamemode

if(strcmp(cmdtext, "/test", true)==0) // in onplayercommand
{
if(VehicleGod[playerid] == 0)
{
VehicleGod[playerid] = 1;
// Here you fuction set vehicle god on

}
else
{
VehicleGod[playerid] = 0;
// Here you fuction (set vehicle god off)

}

}
Reply
#3

Is that right?
Код:
if(strcmp(cmdtext, "/vg", true)==0)
{
        if(God[playerid] == 0)
        {
        God[playerid] = 1;
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Włączyłeś nieśmiertelność pojazdu. Wpisz /vg aby go wyłączyć.");
        }
        else
        {
        God[playerid] = 0;
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Wyłączyłeś nieśmiertelność pojazdu. Aby ją włączyć ponownie wpisz /vg.");
        }
		return 1;
}
Reply
#4

Код:
if(strcmp(cmdtext, "/vg", true)==0)
{
        if(God[playerid] == 0)
        {
        God[playerid] = 1;
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Włączyłeś nieśmiertelność pojazdu. Wpisz /vg aby go wyłączyć.");
        SetPlayerVehicleHealth(GetPlayerVehicleID(playerid) == 9999999);
        }
        else
        {
        God[playerid] = 0;
        SendClientMessage(playerid,COLOR_LIGHTBLUE,"Wyłączyłeś nieśmiertelność pojazdu. Aby ją włączyć ponownie wpisz /vg.");
                SetPlayerVehicleHealth(GetPlayerVehicleID(playerid) == 100);
        }
		return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)