help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help (
/showthread.php?tid=588408)
help -
Jimmi - 08.09.2015
Please move command on zcmd+sscanf?
Код:
//========================================[CMD:OPR]============================================================
CMD:opr(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pTrial] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF}: /opr [playerid/PartOfName]");
return 1;
}
foreach(Player,i){
if(IsInChat[i] > 0 ) {
SendClientMessage(playerid, 0xFFFFFFF, "Asteapta, un report este deja in curs de procesare.");
}
}
IsInChat[idplayer] = 1;
IsInChat[playerid] = 1;
new idplayer;
idplayer = ReturnUser(tmp);
new numeplayer[182];
GetPlayerName(idplayer, numeplayer, sizeof(numeplayer));
if(IsPlayerConnected(idplayer))
{
if(idplayer != INVALID_PLAYER_ID)
{
if (idplayer == playerid)
{
SendClientMessage(playerid, COLOR_WHITE, "Nu iti poti da /opr singur.");
return 1;
}
if(GetPVarInt(idplayer, "Report") == 1)
{
format(string,sizeof(string),"** Administratorul{0066FF} %s {FFFFFF}a deschis reportul dvs.Live chat-ul a fost activat! Folositi (/rc).", sendername, numeplayer);
SendClientMessage(idplayer,COLOR_WHITE,string);
SendClientMessage(playerid,COLOR_WHITE,"[REPORT]: Reportul a fost deschis! Pentru a vorbi in live chat folositi {0066FF}(/ra).");
SetPVarInt(playerid,"LiveChat",1);
SetPVarInt(idplayer,"LiveChat",1);
SetPVarInt(idplayer,"Report",0);
SetPVarInt(playerid,"RJucator",idplayer);
SetPVarInt(idplayer,"RJucator",playerid);
format(string, sizeof(string), "{0066FF}%s {B9E1EB}a raspuns cererii de ajutor a lui{0066FF} %s", sendername, numeplayer);
ABroadCast(COLOR_YELLOW, string,1);
ExecCMD[playerid]++;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "[Anti-Abuz] Acel player nu a cerut ajutor!");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Acel jucator nu este conectat.");
}
}
}
SaveExecCMDS(playerid, "/opr", ExecCMD[playerid]);
return 1;
}
Re: help -
Jimmi - 08.09.2015
upppp
Re: help -
IceBilizard - 08.09.2015
try
pawn Код:
CMD:opr(playerid, params[])
{
new idplayer;
new numeplayer[182];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pTrial] >= 1 || PlayerInfo[playerid][pAdmin] >= 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if (sscanf(params, "u", idplayer)) return SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF}: /opr [playerid/PartOfName]");
foreach(Player,i)
{
if(IsInChat[i] > 0 )
{
SendClientMessage(playerid, 0xFFFFFFF, "Asteapta, un report este deja in curs de procesare.");
}
}
IsInChat[idplayer] = 1;
IsInChat[playerid] = 1;
GetPlayerName(idplayer, numeplayer, sizeof(numeplayer));
if(IsPlayerConnected(idplayer))
{
if(idplayer != INVALID_PLAYER_ID)
{
if (idplayer == playerid)
{
SendClientMessage(playerid, COLOR_WHITE, "Nu iti poti da /opr singur.");
return 1;
}
if(GetPVarInt(idplayer, "Report") == 1)
{
format(string,sizeof(string),"** Administratorul{0066FF} %s {FFFFFF}a deschis reportul dvs.Live chat-ul a fost activat! Folositi (/rc).", sendername, numeplayer);
SendClientMessage(idplayer,COLOR_WHITE,string);
SendClientMessage(playerid,COLOR_WHITE,"[REPORT]: Reportul a fost deschis! Pentru a vorbi in live chat folositi {0066FF}(/ra).");
SetPVarInt(playerid,"LiveChat",1);
SetPVarInt(idplayer,"LiveChat",1);
SetPVarInt(idplayer,"Report",0);
SetPVarInt(playerid,"RJucator",idplayer);
SetPVarInt(idplayer,"RJucator",playerid);
format(string, sizeof(string), "{0066FF}%s {B9E1EB}a raspuns cererii de ajutor a lui{0066FF} %s", sendername, numeplayer);
ABroadCast(COLOR_YELLOW, string,1);
ExecCMD[playerid]++;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "[Anti-Abuz] Acel player nu a cerut ajutor!");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Acel jucator nu este conectat.");
}
}
}
SaveExecCMDS(playerid, "/opr", ExecCMD[playerid]);
return 1;
}