SA-MP Forums Archive
Help me with this dcmd - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me with this dcmd (/showthread.php?tid=184980)



Help me with this dcmd - dark_clown - 22.10.2010

hey, i made this cmd thats if u use it more than 3 times it sends a message to admins saying %s(%i) is spamming nrg blocknrg him but if i use it once then i cant use it anymore because....
JUST look at the code
Код:
dcmd_nrg(playerid,params[])
{
	#pragma unused params
	new id,string[128],pName[MAX_PLAYER_NAME];
 	GetPlayerName(id,pName,sizeof(pName));
 	format(string, sizeof string, "%s(%i)passed /nrg limit /blocknrg him",pName,playerid);
	if(PInfo[playerid][blockednrg] == 1) return SendClientMessage(playerid,red,"ERROR: You cant use nrg[reason: spammed nrg cmd]");
	if(PInfo[playerid][blockednrg] > 3) return MessageToAdmins(red, string);
	GetPlayerPos(playerid,X,Y,Z);
	PutPlayerInVehicle(playerid,CreateVehicle(522,X,Y, Z,0,-1,147,147),0);
	PInfo[playerid][blockednrg]++;
	return 1;
}



Re: Help me with this dcmd - Jeffry - 22.10.2010

pawn Код:
dcmd_nrg(playerid,params[])
{
    #pragma unused params
    new id,string[128],pName[MAX_PLAYER_NAME];
    GetPlayerName(id,pName,sizeof(pName));
    format(string, sizeof string, "%s(%i)passed /nrg limit /blocknrg him",pName,playerid);
    if(PInfo[playerid][blockednrg] > 3)
    {
        SendClientMessage(playerid,red,"ERROR: You cant use nrg[reason: spammed nrg cmd]");
        return MessageToAdmins(red, string);
    }
    GetPlayerPos(playerid,X,Y,Z);
    PutPlayerInVehicle(playerid,CreateVehicle(522,X,Y, Z,0,-1,147,147),0);
    PInfo[playerid][blockednrg]++;
    return 1;
}
Should do it.


Re: Help me with this dcmd - dark_clown - 22.10.2010

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
pawn Код:
dcmd_nrg(playerid,params[])
{
    #pragma unused params
    new id,string[128],pName[MAX_PLAYER_NAME];
    GetPlayerName(id,pName,sizeof(pName));
    format(string, sizeof string, "%s(%i)passed /nrg limit /blocknrg him",pName,playerid);
    if(PInfo[playerid][blockednrg] > 3)
    {
        SendClientMessage(playerid,red,"ERROR: You cant use nrg[reason: spammed nrg cmd]");
        return MessageToAdmins(red, string);
    }
    GetPlayerPos(playerid,X,Y,Z);
    PutPlayerInVehicle(playerid,CreateVehicle(522,X,Y, Z,0,-1,147,147),0);
    PInfo[playerid][blockednrg]++;
    return 1;
}
Should do it.
thanks jeff but iv fixed it , but still thanks


Re: Help me with this dcmd - Jeffry - 22.10.2010

Even better then.
Have fun!