01.10.2014, 20:50
Ql й msm a funзгo pro player usar um cmd? Tipo ao spawnar ele usar /spawneigalera
public OnPlayerCommandText(playerid,cmdtext[]) { //Seu comando aqui }
CMD:mycommand(playerid, params[]) {
SendClientMessage(playerid, -1, "Vocк usou o comando: mycommand);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]){ if (strcmp(cmd, "/Deslogartodos", true) ==0 && PlayerInfo[playerid][pAdmin] == 3000) { if(IsPlayerConnected(playerid)) { GetPlayerName(playerid, sendername, sizeof(sendername)); for(new i = 0; i < MaiorID; i++) { if(IsPlayerConnected(i)) { gPlayerLogged[i] = 0; format(string, sizeof(string), "AdmCmd: %s Deslogou Todos os Players",sendername); SendClientMessage(i, COLOR_LIGHTRED, string); Kick(i); SendRconCommand("exit"); } } } return 1; } } |
stock ForcarComando(playerid, cmdtext[])
{
CallRemoteFunction("OnPlayerCommandText", "ds", playerid, cmdtext);
return true;
}
ForcarComando(playerid, "/admins");//Forзarб o jogador б usar o comando /admins assim que ele entrar
CMD:comandoid( p, pr[], PlayerID, cmdtext[ 30 ] )
{
if( sscanf( pr, "us[25]", PlayerID, cmdtext ) ) return SendClientMessage( p, -1, #Use /comandoid [ID] );
return OnPlayerCommandReceived( PlayerID, cmdtext ), true;
}
strcmp:
pawn Код:
pawn Код:
pawn Код:
|