SA-MP Forums Archive
HelpMe #1 [+REP] - 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)
+--- Thread: HelpMe #1 [+REP] (/showthread.php?tid=293742)



HelpMe #1 [+REP] - NessaHD - 29.10.2011

Who can help me?
- I want someone that can give me a WORKING example of a admin command
For example how could i make this a admin command
pawn Код:
if (strcmp("/minigun", cmdtext, true, 10) == 0)
    {
        //Give's you a minigun
        GivePlayerWeapon(playerid, 38, 500);
        SendClientMessage(playerid, 0xFFFFFFAA, "You've got a minigun!");

        return 1;

    }
How to make ONLY admins use this command. And when someone else try to use it, there should be:
pawn Код:
SendClientMessage(playerid, SOME_COLOR, "You are not admin - Only admins can use this command");
Dont forget, +rep to the guy that helps me, and make a example of it down in description.

- cruteX


Re: HelpMe #1 [+REP] - FireCat - 29.10.2011

pawn Код:
if (strcmp("/minigun", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, SOME_COLOR, "You are not admin - Only admins can use this command");
        GivePlayerWeapon(playerid, 38, 500);
        SendClientMessage(playerid, 0xFFFFFFAA, "You've got a minigun!");
        return 1;
    }



Re: HelpMe #1 [+REP] - NessaHD - 29.10.2011

Umm :/


Quote:

C:\DOCUME~1\HP_Ejer\SKRIVE~1\CX-FRE~1.1\FILTER~1\xLuxus.pwn(57) : error 076: syntax error in the expression, or invalid function call
C:\DOCUME~1\HP_Ejer\SKRIVE~1\CX-FRE~1.1\FILTER~1\xLuxus.pwn(57) : error 029: invalid expression, assumed zero
C:\DOCUME~1\HP_Ejer\SKRIVE~1\CX-FRE~1.1\FILTER~1\xLuxus.pwn(57) : warning 215: expression has no effect
C:\DOCUME~1\HP_Ejer\SKRIVE~1\CX-FRE~1.1\FILTER~1\xLuxus.pwn(57) : error 001: expected token: ";", but found "return"
C:\DOCUME~1\HP_Ejer\SKRIVE~1\CX-FRE~1.1\FILTER~1\xLuxus.pwn(57) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

4 errors, the line is the same as you gave me..


Re: HelpMe #1 [+REP] - NessaHD - 29.10.2011

Fixed, its because i forgot (playerid) after IsPlayerAdmin, thx i rep you )


Re: HelpMe #1 [+REP] - Tigerkiller - 29.10.2011

#deleted


Re: HelpMe #1 [+REP] - =WoR=G4M3Ov3r - 29.10.2011

PHP код:
if (strcmp("/minigun"cmdtrue) == 0)
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"You are not authorized to use that command!"); 
    
GivePlayerWeapon(playerid38500); 
    return 
1

Edit: NVM.


Re: HelpMe #1 [+REP] - NessaHD - 29.10.2011

Thx everbody else, for helping me
- Firecat, sorry it says i must spread out some rep before ill give to you again XD..