DCMD commands prob
#1

Hi,i've this commands in DCMD:

Код:
dcmd_g(playerid, params[])
{
	new id;
	if(sscanf(params, "u", id))
		return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /goto [nick/id]");
	if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id))
	    return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is not connected.");

	new Float:Pos[3];
	if(IsPlayerInAnyVehicle(playerid))
 	{
		GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
		SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0]+2, Pos[1], Pos[2]);
		PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
		SetPlayerInterior(playerid, GetPlayerInterior(id));
		SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
	}
	else
	{
	 	GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
		SetPlayerPos(playerid, Pos[0]+1, Pos[1], Pos[2]);
		SetPlayerInterior(playerid, GetPlayerInterior(id));
		SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
	}
	return 1;
}

dcmd_get(playerid, params[])
{
	new id;
 	if(sscanf(params, "u", id))
		return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /gethere [nick/id]");
	if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id))
	    return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is not connected.");

	new Float:Pos[3];
    if(IsPlayerInAnyVehicle(id))
    {
		GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
		SetVehiclePos(GetPlayerVehicleID(id), Pos[0]+2, Pos[1], Pos[2]);
		PutPlayerInVehicle(id, GetPlayerVehicleID(id), 0);
		SetPlayerInterior(playerid, GetPlayerInterior(id));
		SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
	}
	else
	{
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
		SetPlayerPos(id, Pos[0]+1, Pos[1], Pos[2]);
		SetPlayerInterior(playerid, GetPlayerInterior(id));
		SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
	}
	return 1;
}

dcmd_explode(playerid, params[])
{
	new id,toplayerid;
	if(sscanf(params, "u", id))
	    return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /explode [nick/id]");
	if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id))
	    return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is not connected!");
    new expString[128], adminName[24], exploName[24];
    GetPlayerName(playerid, adminName, 24);
    GetPlayerName(toplayerid, exploName, 24);
    format(expString, 128, "Player %s was exploded by Administrator %s.", exploName, adminName);
    SendClientMessageToAll(COLOR_RED, expString);
    new str[100];
    format(str,sizeof str,"0,4Player %s was exploded by Administrator %s.", exploName, adminName);
   	IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
	new Float:Pos[3];
	GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
	CreateExplosion(Pos[0], Pos[1], Pos[2], 0, 10.0);
	return 1;
}

dcmd_slap(playerid, params[])
{
    new id,toplayerid;
	if(sscanf(params, "u", id))
	    return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /slap [nick/id]");
	if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id))
	    return SendClientMessage(playerid, COLOR_RED, "ERROR: That player is not connected!");

    new slString[128], adminName[24], slapName[24];
    GetPlayerName(playerid, adminName, 24);
    GetPlayerName(toplayerid, slapName, 24);
    format(slString, 128, "Player %s was slapped by Administrator %s.", slapName, adminName);
    SendClientMessageToAll(COLOR_RED, slString);
    new str[100];
    format(str,sizeof str,"0,4Player %s was slapped by Administrator %s.", slapName, adminName);
   	IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
	new Float:Pos[3];
	GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
	SetPlayerPos(id, Pos[0], Pos[1], Pos[2]+7);
	return 1;
}
And i've a problem,the gm compiles fine,but if i add:

if(PlayerInfo[playerid][AdminLevel] > 2)
{

After

dcmd_EXAMPLECMD(playerid, params[])
{

I get tons of errors.

Код:
  if(PlayerInfo[playerid][AdminLevel] > 2)
Is the variable used for admin levels.

Any help?
Reply


Messages In This Thread
DCMD commands prob - by Face9000 - 17.12.2010, 14:07
Re: DCMD commands prob - by Nero_3D - 17.12.2010, 14:10
Re: DCMD commands prob - by Face9000 - 17.12.2010, 14:13
Re: DCMD commands prob - by PowerPC603 - 17.12.2010, 16:17
Re: DCMD commands prob - by Face9000 - 17.12.2010, 17:09
Re: DCMD commands prob - by Face9000 - 17.12.2010, 19:32
Re: DCMD commands prob - by Scenario - 17.12.2010, 19:34
Re: DCMD commands prob - by Face9000 - 17.12.2010, 19:35
Re: DCMD commands prob - by matute - 17.12.2010, 20:53
Re: DCMD commands prob - by Scenario - 17.12.2010, 22:39

Forum Jump:


Users browsing this thread: 2 Guest(s)