SA-MP Forums Archive
Can't see whats Wrong - 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: Can't see whats Wrong (/showthread.php?tid=248431)



Can't see whats Wrong - Basker101 - 13.04.2011

Hey I'm Just started learing sscanf and ZCMDS But I have this problem

Код:
CMD:flame(playerid,params[])
	{
	    new player, Float:Pos[3];
	    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"your are not an admin");
	    if(sscanf(params,"u", player)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /flame [playerid]");
	    if(!IsPlayerConnected(player)) return SendClientMessage(playerid,COLOR_RED,"That Player Is Not Online !");
	    else if(IsPlayerAdmin(playerid))
	    {
	 		GetPlayerPos(player,Pos[0], Pos[1], Pos[2]);
			CreateExplosion(Pos[0], Pos[1], Pos[2], 12, 5);
			SendClientMessage(player,COLOR_RED,"Your have Been Blow away");
			SendClientMessage(playerid,COLOR_BLUE,"Your have Blow up a Player");
			return 1;
	    }
		return 0;
	}
When I'm Compile the script there is no errors but when I'll try to use /Flame It just sends me a SERVER: Unknow Command Can't Figure out what should be wrong ?


Peace Out "Basker"


Edit: Now I'll use:
Код:
(Line 203)new Float:x, Float:y, Float:z;
But I Get this The Error is on Line 203
Код:
error 001: expected token: ";", but found "new"



Re: Can't see whats Wrong - airsoft - 13.04.2011

try
instead of
pawn Код:
else if(IsPlayerAdmin(playerid))
USE Just
PHP код:
else 



Re: Can't see whats Wrong - Basker101 - 13.04.2011

Still Don't Work

Код:
CMD:flame(playerid,params[])
	{
	    new player, Float:Pos[3];
	    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"your are not an admin");
	    if(sscanf(params,"u", player)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /flame [playerid]");
	    if(!IsPlayerConnected(player)) return SendClientMessage(playerid,COLOR_RED,"That Player Is Not Online !");
	    else
		(IsPlayerAdmin(playerid));
	    {
	 		GetPlayerPos(player,Pos[0], Pos[1], Pos[2]);
			CreateExplosion(Pos[0], Pos[1], Pos[2], 12, 5);
			SendClientMessage(player,COLOR_RED,"Your have Been Blow away");
			SendClientMessage(playerid,COLOR_BLUE,"Your have Blow up a Player");
			return 1;
	    }
	}
Gives me No Errors Still


Re: Can't see whats Wrong - omer5198 - 13.04.2011

here you go... tell me if there anything wrong!
pawn Код:
CMD:flame(playerid,params[])
    {
        new player, Float:Pos[3];
        if(sscanf(params,"u", player)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /flame [playerid]");
        if(!IsPlayerConnected(player)) return SendClientMessage(playerid,COLOR_RED,"That Player Is Not Online !");
        if(IsPlayerAdmin(playerid));
        {
            new Float:x, Float:y, Float:z;
                        GetPlayerPos(player, x, y, z);
            CreateExplosion(x, y, z, 12, 5);
            SendClientMessage(player,COLOR_RED,"Your have Been Blow away");
            SendClientMessage(playerid,COLOR_BLUE,"Your have Blow up a Player");
        }
            else
            {
                   SendClientMessage(playerid,COLOR_RED,"your are not an admin");
            }
    }



Re: Can't see whats Wrong - airsoft - 13.04.2011

Well, i dont see anything wrong, go test it


btw instead of [code][ /code] use [pawn][ /pawn] it looks better with pawn code


Re: Can't see whats Wrong - Basker101 - 13.04.2011

Gives me Two Errors


Код:
(205) : error 036: empty statement
(212) : error 029: invalid expression, assumed zero
Код:
(205)if(IsPlayerAdmin(playerid));
Код:
(212)else



Re: Can't see whats Wrong - omer5198 - 13.04.2011

Quote:
Originally Posted by Basker101
Посмотреть сообщение
Gives me Two Errors


Код:
(205) : error 036: empty statement
(212) : error 029: invalid expression, assumed zero
Код:
(205)if(IsPlayerAdmin(playerid));
Код:
(212)else
sorry... i wrote it fast so i didn't noticed... just remove the ; frome th IsPlayerAdmin...
Код:
if(IsPlayerAdmin(playerid));
>>>>>>
Код:
if(IsPlayerAdmin(playerid))
- it will fix the other error too...


Re: Can't see whats Wrong - austin070 - 13.04.2011

pawn Код:
if(IsPlayerAdmin(playerid))
You don't need a ; in that statement.


Re: Can't see whats Wrong - Basker101 - 13.04.2011

Quote:
Originally Posted by omer5198
Посмотреть сообщение
sorry... i wrote it fast so i didn't noticed... just remove the ; frome th IsPlayerAdmin...
Код:
if(IsPlayerAdmin(playerid));
>>>>>>
Код:
if(IsPlayerAdmin(playerid))
- it will fix the other error too...
No Problem But It's Still says "SERVER: unknow Command" when I'll try it ingame ;s



EDIT: My Code Looks like this now

pawn Код:
CMD:flame(playerid,params[])
    {
        new player, Float:Pos[3];
        if(sscanf(params,"u", player)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /flame [playerid]");
        if(!IsPlayerConnected(player)) return SendClientMessage(playerid,COLOR_RED,"That Player Is Not Online !");
        if(IsPlayerAdmin(playerid))
        {
            GetPlayerPos(player,Pos[0], Pos[1], Pos[2]);
            CreateExplosion(Pos[0], Pos[1], Pos[2], 12, 5);
            SendClientMessage(player,COLOR_RED,"Your have Been Blow away");
            SendClientMessage(playerid,COLOR_BLUE,"Your have Blow up a Player");
        }
        else
        {
            SendClientMessage(playerid,COLOR_RED,"your are not an admin");
        }
        return 0;
    }



Re: Can't see whats Wrong - austin070 - 13.04.2011

Put a
pawn Код:
return 1;
between the last 2 closing brackets.