Help me with this dcmd
#1

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;
}
Reply
#2

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.
Reply
#3

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
Reply
#4

Even better then.
Have fun!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)