10.09.2014, 09:49
Hi i want to know how to make this command to can be activated only when i type, /giftcomand,and to can be activated only by admin 6,thanks
if (strcmp(cmd, "/firstgift", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "{FF0000}Nu esti logat!");
return 1;
}
if (hasgotgift == 1) return SendClientMessage(playerid, COLOR_GRAD1, "{FF0000}Deja ai primit cadoul!");
if (PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GRAD1, "{FF0000}Trebuie sa ai level 2!");
return 1;
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] +250000;
PlayerInfo[playerid][pLevel] = PlayerInfo[playerid][pLevel] +1;
format(string, 256, "{00FF00}Felicitari,prin acest cadou ne aniversam deschiderea!",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, 256, "{00FF00}Ai primit 1 level!",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, 256, "{00FF00}Ai primit 250.000$!",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_WHITE, string);
hasgotgift = 1;
}
return 1;
}
if (strcmp(cmd, "/firstgift", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "{FF0000}Nu esti logat!");
return 1;
}
if (hasgotgift == 1) return SendClientMessage(playerid, COLOR_GRAD1, "{FF0000}Deja ai primit cadoul!");
if (PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GRAD1, "{FF0000}Trebuie sa ai level 2!");
return 1;
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] +250000;
PlayerInfo[playerid][pLevel] = PlayerInfo[playerid][pLevel] +1;
format(string, 256, "{00FF00}Felicitari,prin acest cadou ne aniversam deschiderea!",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, 256, "{00FF00}Ai primit 1 level!",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, 256, "{00FF00}Ai primit 250.000$!",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_WHITE, string);
hasgotgift = 1;
}
return 1;
}

