PDA

View Full Version : GetPlayerWeapon : Tag Mismatch = problem


cray1100
07/08/2013, 03:18 AM
I get errors on the GetPlayerWeapon line...

CMD:skydive(playerid, params[])
{
!IsPlayerLuxAdminLevel(playerid, 3) || !IsPlayerAdmin(playerid);
{
new Float:pPos[3];
new km;
if(sscanf(params, "i", km)) return SendClientMessage(playerid, COLOR_RED, "John: /skydive [meters]");
if(km <= -1 || km >= 3001) return SendClientMessage(playerid, COLOR_RED, "John: You cannot use negative amount or amounts higher than 3000! Its too Dangerous!");
if(!GetPlayerWeapon(playerid) == 46) return SendClientMessage(playerid, COLOR_RED, "John: Probably would've been better with a /chute...");
if(IsPlayerInWater(playerid))return SendClientMessage(playerid, COLOR_RED, "John: You cannot be force pushed while in water!");
GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
SetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]+km);
}
return 1;
}

C:\Documents and Settings\**\**\**\**\filterscripts\DRP.pwn(113) : warning 213: tag mismatch

PT
07/08/2013, 03:25 AM
try

CMD:skydive(playerid, params[])
{
if(!IsPlayerLuxAdminLevel(playerid, 3) || !IsPlayerAdmin(playerid));
{
new Float:pPos[3], km;
if(sscanf(params, "i", km)) return SendClientMessage(playerid, COLOR_RED, "John: /skydive [meters]");
if(km <= -1 || km >= 3001) return SendClientMessage(playerid, COLOR_RED, "John: You cannot use negative amount or amounts higher than 3000! Its too Dangerous!");
if(GetPlayerWeapon(playerid) != 46) return SendClientMessage(playerid, COLOR_RED, "John: Probably would've been better with a /chute...");
if(IsPlayerInWater(playerid))return SendClientMessage(playerid, COLOR_RED, "John: You cannot be force pushed while in water!");
GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
SetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]+km);
}
return 1;
}

cray1100
07/08/2013, 03:33 AM
The code works, but the way you did...
if(!IsPlayerLuxAdminLevel(playerid, 3) || !IsPlayerAdmin(playerid));
I get a empty statement error... I need help fixing this also, the way i use it it doesnt check for admin...

PT
07/08/2013, 03:55 AM
if you want only admins use that command, put this way

CMD:skydive(playerid, params[])
{
if(IsPlayerLuxAdminLevel(playerid,3) || IsPlayerAdmin(playerid));
{
new Float:pPos[3], km;
if(sscanf(params, "i", km)) return SendClientMessage(playerid, COLOR_RED, "John: /skydive [meters]");
if(km <= -1 || km >= 3001) return SendClientMessage(playerid, COLOR_RED, "John: You cannot use negative amount or amounts higher than 3000! Its too Dangerous!");
if(GetPlayerWeapon(playerid) != 46) return SendClientMessage(playerid, COLOR_RED, "John: Probably would've been better with a /chute...");
if(IsPlayerInWater(playerid))return SendClientMessage(playerid, COLOR_RED, "John: You cannot be force pushed while in water!");
GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
SetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]+km);
}
else SendClientMessage(playerid, COLOR_RED, "Error: You are not an Admin!");
return 1;
}

or if you want only player uses that command use;

CMD:skydive(playerid, params[])
{
if(IsPlayerLuxAdmin(playerid) || !IsPlayerAdmin(playerid));
{
new Float:pPos[3], km;
if(sscanf(params, "i", km)) return SendClientMessage(playerid, COLOR_RED, "John: /skydive [meters]");
if(km <= -1 || km >= 3001) return SendClientMessage(playerid, COLOR_RED, "John: You cannot use negative amount or amounts higher than 3000! Its too Dangerous!");
if(GetPlayerWeapon(playerid) != 46) return SendClientMessage(playerid, COLOR_RED, "John: Probably would've been better with a /chute...");
if(IsPlayerInWater(playerid))return SendClientMessage(playerid, COLOR_RED, "John: You cannot be force pushed while in water!");
GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
SetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]+km);
}
else SendClientMessage(playerid, COLOR_RED, "Error: You are not an player!");
return 1;
}

cray1100
07/08/2013, 04:15 AM
LOL... Now I see, I have done this before, just not familiar anymore as much, i havent scripted pawn in a while... Thanks and +repped!

cray1100
07/08/2013, 04:35 AM
Nope, i still get the empty statement error ):

nickdodd25
07/08/2013, 06:39 AM
Nope, i still get the empty statement error ):
Your missing a "(" before isplayeradmin...

if(IsPlayerLuxAdmin(playerid) || (!IsPlayerAdmin(playerid));

cray1100
07/08/2013, 07:05 AM
Nope i have that, but now i get this
error 029: invalid expression, assumed zero

on both of these
if(IsPlayerLuxAdminLevel(playerid, 3)) || (IsPlayerAdmin(playerid));
and
else SendClientMessage(playerid, COLOR_RED, "John: You are not an Admin!");

PLEASE HELP ME!!! Will +rep...

dominik523
07/08/2013, 08:12 AM
try this:
if(IsPlayerLuxAdminLevel(playerid, 3) || IsPlayerAdmin(playerid));