PDA

View Full Version : /explode and /slap //


PabloDiCostanzo
03/03/2013, 12:45 PM
Greetings,

I have this commands, but when I complie I get warnings


C:\Documents and Settings\Administrador\Escritorio\Gang Wars\filterscripts\LuxAdmin.pwn(3433) : warning 209: function "dcmd_explode" should return a value
C:\Documents and Settings\Administrador\Escritorio\Gang Wars\filterscripts\LuxAdmin.pwn(3851) : warning 209: function "dcmd_slap" should return a value


Explode:

dcmd_explode(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 2)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);

if(!strlen(params)) return
SendClientMessage(playerid, grey, "USAGE: /explode [PlayerID] [Reason]") &&
SendClientMessage(playerid, orange, "ATENTION: Function will explode the specified player");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);

if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
SendCommandToAdmins(playerid,"Explode");
new Float:burnx, Float:burny, Float:burnz;
GetPlayerPos(player1,burnx, burny, burnz);
CreateExplosion(burnx, burny , burnz, 7,10.0);

if(strlen(tmp2))
{
}
else
{
format(string,sizeof(string),"You have been exploded by Administrator %s ",adminname);
SendClientMessage(player1,blue,string);
format(string,sizeof(string),"You have Exploded %s", playername);
return SendClientMessage(playerid,BlueMsg,string);
}
}
else return SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin");
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}


Slap:

dcmd_slap(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 1)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);

if(!strlen(params)) return
SendClientMessage(playerid, grey, "USAGE: /slap [PlayerID/PartOfName] [Reason]") &&
SendClientMessage(playerid, orange, "ATENTION: Function will slap the specified player");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);

if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
SendCommandToAdmins(playerid,"Slap");
new Float:Health;
new Float:x, Float:y, Float:z;
GetPlayerHealth(player1,Health);
SetPlayerHealth(player1,Health-25);
GetPlayerPos(player1,x,y,z);
SetPlayerPos(player1,x,y,z+5);
PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
PlayerPlaySound(player1,1190,0.0,0.0,0.0);

if(strlen(tmp2))
{

}
else
{
format(string,sizeof(string),"You have slapped %s ",playername);
return SendClientMessage(playerid,red,string);
}
}
else return SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin");
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}


How can I fix?

Regards,
Pablo

Mean
03/03/2013, 12:50 PM
dcmd_explode(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 2)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);

if(!strlen(params)) return
SendClientMessage(playerid, grey, "USAGE: /explode [PlayerID] [Reason]") &&
SendClientMessage(playerid, orange, "ATENTION: Function will explode the specified player");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);

if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
SendCommandToAdmins(playerid,"Explode");
new Float:burnx, Float:burny, Float:burnz;
GetPlayerPos(player1,burnx, burny, burnz);
CreateExplosion(burnx, burny , burnz, 7,10.0);

if(strlen(tmp2))
{
}
else
{
format(string,sizeof(string),"You have been exploded by Administrator %s ",adminname);
SendClientMessage(player1,blue,string);
format(string,sizeof(string),"You have Exploded %s", playername);
SendClientMessage(playerid,BlueMsg,string);
}
}
else SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin");
}
else ErrorMessages(playerid, 1);
}
else SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
return 1;
}



dcmd_slap(playerid,params[])
{
if(AccInfo[playerid][LoggedIn] == 1)
{
if(AccInfo[playerid][Level] >= 1)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);

if(!strlen(params)) return
SendClientMessage(playerid, grey, "USAGE: /slap [PlayerID/PartOfName] [Reason]") &&
SendClientMessage(playerid, orange, "ATENTION: Function will slap the specified player");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);

if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
SendCommandToAdmins(playerid,"Slap");
new Float:Health;
new Float:x, Float:y, Float:z;
GetPlayerHealth(player1,Health);
SetPlayerHealth(player1,Health-25);
GetPlayerPos(player1,x,y,z);
SetPlayerPos(player1,x,y,z+5);
PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
PlayerPlaySound(player1,1190,0.0,0.0,0.0);

if(strlen(tmp2))
{

}
else
{
format(string,sizeof(string),"You have slapped %s ",playername);
SendClientMessage(playerid,red,string);
}
}
else SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin");
}
else ErrorMessages(playerid, 1);
}
else SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
return 1;
}

PabloDiCostanzo
03/03/2013, 03:36 PM
+REP

-Solved