/fam - fake admin message -
Saddin - 17.02.2016
There are two players for example. One is admin, another is normal player
When admin type for example: /fam Normal_Player I am so hungry.
it have to send message to all like: Normal_Player: I am so hungry.
I have problem with this command, if anyone can help, i would appreciate it
Код:
//------------------------------------------------------------------------------
YCMD:fam(playerid,params[],help)
{
#pragma unused help
new giveplayer, string[528], result[64];
if(IsPlayerConnected(playerid) && gPlayerLogged[playerid] == 0) return LOGINGRESKA
if(PlayerInfo[playerid][pAdminLevel] < 1) return ADMINGRESKA
if(PlayerInfo[playerid][pSpawn] == 5) return AREAGRESKA
if(AdminDuty[playerid] == 0) return DUTYGRESKA
if(sscanf(params, "u{s[130]}", giveplayer, result)) return SendClientMessage(playerid, C_KORISTENJE, "[UPUTA]: /fam [ID/DioImena] [Tekst]");
if(giveplayer == IPI) return SCM(playerid, MGRESKA"Odabrana osoba nije prijavljena na svoj korisnicki akaunt - provjerite unesene parametre.");
format(string, sizeof(string), "(( ADMIN %s: %s. ))", giveplayer, result);
SendClientMessageToAll(0xF5DEB3AA, string);
return 1;
}
Re: /fam - fake admin message -
saffierr - 17.02.2016
Your type of scripting is pretty fucked up, you shouldn't be using pragma...
I will help you as soon as I get on my laptop.
Re: /fam - fake admin message -
Saddin - 18.02.2016
i copied command /goto, i think. And i tried to do it like that command, why is it not good to use pragma?
and thank you in forward
Re: /fam - fake admin message -
Trucido - 18.02.2016
Idk why youre using pragma.. theres no need for it there.
anyway, work on this, im not sure if it was what u asked for
Код:
YCMD:fam(playerid,params[],help)
{
new player, string[144], pName[MAX_PLAYER_NAME];
// checks..
if(PlayerInfo[playerid][pAdminLevel] < 1)
return SendClientMessage(playerid, -1, "your not an admin.");
// do more checks here..
if(sscanf(params, "us[130]", player, string)
return SendClientMessage(playerid, -1, "/fam [id] [msg]");
if ( !IsPlayerConnected(player) || !gPlayerLogged[player] )
return SendClientMessage(playerid, -1, "invalid player");
GetPlayerName(player, pName, sizeof(pName));
format(string, sizeof(string), "%s: %s", pName, string);
SendClientMessageToAll(0xF5DEB3AA, string);
}