SA-MP Forums Archive
Script issue - 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: Script issue (/showthread.php?tid=73583)



Script issue - Divine - 16.04.2009

pawn Код:
public OnPlayerCommand ... blah blah ...

    if(strcmp(cmdtext, "/adminon", true) == 0) {                      // (549) : error 010: invalid function or declaration
    SendClientMessage(playerid, 0xF97804FF, "You Just God Admin Powers!");
    SetPlayerHealth(playerid, 9999999999.99);
    SetPlayerArmour(playerid, 9999999999.99);
    GivePlayerWeapon(playerid, 38, 999999999);
    }
    return 1;                                            //   (555) : error 010: invalid function or declaration
}

I dont get it ...
All of my other commands are totally in the same way ... and not pissing me off
but THIS one ...
Can any one help me out ?? ... this is so stupid !!!

...................


Re: WHAT THE F**K IS WRONG ?!?!? (HELP ME) - Weirdosport - 16.04.2009

I can only suggest that the commands before it are not finished properly. Also the return 1; is meat to be inside the brackets..

pawn Код:
if(strcmp(cmdtext, "/adminon", true) == 0)
    {      
    SendClientMessage(playerid, 0xF97804FF, "You Just God Admin Powers!");
    SetPlayerHealth(playerid, 9999999999.99);
    SetPlayerArmour(playerid, 9999999999.99);
    GivePlayerWeapon(playerid, 38, 999999999);
    return 1;
    }



Re: WHAT THE F**K IS WRONG ?!?!? (HELP ME) - Divine - 16.04.2009

Quote:
Originally Posted by Weirdosport
I can only suggest that the commands before it are not finished properly. Also the return 1; is meat to be inside the brackets..

pawn Код:
if(strcmp(cmdtext, "/adminon", true) == 0)            // (549) : error 010: invalid function or declaration
    {    
    SendClientMessage(playerid, 0xF97804FF, "You Just God Admin Powers!");
    SetPlayerHealth(playerid, 9999999999.99);
    SetPlayerArmour(playerid, 9999999999.99);
    GivePlayerWeapon(playerid, 38, 999999999);
    return 1;                                // (555) : error 010: invalid function or declaration
    }
same man ...



Re: WHAT THE F**K IS WRONG ?!?!? (HELP ME) - Weirdosport - 16.04.2009

if(strcmp(cmdtext, "/adminon", true) == 0)

is not your problem, I tried it myself. Make sure that in the previous command the correct number of brackets are used..


Re: WHAT THE F**K IS WRONG ?!?!? (HELP ME) - Divine - 16.04.2009

Quote:
Originally Posted by Weirdosport
if(strcmp(cmdtext, "/adminon", true) == 0)

is not your problem, I tried it myself. Make sure that in the previous command the correct number of brackets are used..
I just dont get it ...
...
All of my other commands are totally the same ...
and only this one fails ...
i tried editing it ... still the same


Re: WHAT THE F**K IS WRONG ?!?!? (HELP ME) - Divine - 16.04.2009

ok ...
i tried switching places ....
now i get the same on the idiotic /kill command !!!
but the /adminon works. ...
what the hell ?


Re: WHAT THE F**K IS WRONG ?!?!? (HELP ME) - deathdealer - 16.04.2009

Quote:
Originally Posted by Divine
ok ...
i tried switching places ....
now i get the same on the idiotic /kill command !!!
but the /adminon works. ...
what the hell ?
Hello Divine,

send us the command before and after the command your making, and then show us the error.
This way we can figure something out, and get somewhere.

Thank You,
Scott-Cameron


Re: WHAT THE F**K IS WRONG ?!?!? (HELP ME) - Divine - 16.04.2009

Quote:
Originally Posted by deathdealer
Hello Divine,

send us the command before and after the command your making, and then show us the error.
This way we can figure something out, and get somewhere.

Thank You,
Scott-Cameron
oops
...........
pawn Код:
if(strcmp(cmdtext, "/kill", true) == 0)            // (549) : error 010: invalid function or declaration
{      
SendClientMessage(playerid, 0xF97804FF, "You Just God Admin Powers!");
SetPlayerHealth(playerid, 0.0);
}
return 1;                                // (554) : error 010: invalid function or declaration
}
.... /adminon works now .. i moved it infront of /kill .. now since /kill the last on the commandlist ..
its how I get it




Re: WHAT THE F**K IS WRONG ?!?!? (HELP ME) - deathdealer - 16.04.2009

Hello,

I think it is because you have Return 1 after the braket, try this:

Код:
if(strcmp(cmdtext, "/kill", true) == 0)           
{      
SendClientMessage(playerid, 0xF97804FF, "You Just God Admin Powers!");
SetPlayerHealth(playerid, 0.0);
return 1;  
}                                 
if(strcmp(cmdtext, "/adminon", true) == 0) 
	{      
	SendClientMessage(playerid, 0xF97804FF, "You Just God Admin Powers!");
	SetPlayerHealth(playerid, 9999999999.99);
	SetPlayerArmour(playerid, 9999999999.99);
	GivePlayerWeapon(playerid, 38, 999999999);
	return 1; 
	}
I'm not to sure, if that will work but i will test it on my computer too.

Try it, and then post back.

Thank You,
Scott-Cameron


Re: WHAT THE F**K IS WRONG ?!?!? (HELP ME) - Klutty - 16.04.2009

Quote:
Originally Posted by deathdealer
Hello,

I think it is because you have Return 1 after the braket, try this:

Код:
if(strcmp(cmdtext, "/kill", true) == 0)          
{     
SendClientMessage(playerid, 0xF97804FF, "You Just God Admin Powers!");
SetPlayerHealth(playerid, 0.0);
return 1;  
}                                 
if(strcmp(cmdtext, "/adminon", true) == 0) 
{     
	SendClientMessage(playerid, 0xF97804FF, "You Just God Admin Powers!");
	SetPlayerHealth(playerid, 9999999999.99);
	SetPlayerArmour(playerid, 9999999999.99);
	GivePlayerWeapon(playerid, 38, 999999999);
	return 1; 
	}
I'm not to sure, if that will work but i will test it on my computer too.

Try it, and then post back.

Thank You,
Scott-Cameron
Intendation ftw..

pawn Код:
if(strcmp(cmdtext, "/adminon", true) == 0)
{      
    SendClientMessage(playerid, 0xF97804FF, "You Just God Admin Powers!");
    SetPlayerHealth(playerid, 9999999999.99);
    SetPlayerArmour(playerid, 9999999999.99);
    GivePlayerWeapon(playerid, 38, 999999999);
    return 1;
    }