SA-MP Forums Archive
Need a little code for a /donateaccounce CMD - 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: Need a little code for a /donateaccounce CMD (/showthread.php?tid=211734)



Need a little code for a /donateaccounce CMD - iiLiamii - 15.01.2011

Hi There,

Im not a great scripter I have to admit, But I have atleast attempted to do the command that I listed in this subject.
However it turned out a FAIL! For me


Basically what I want to do is do /donateannounce for admins Level 1 and above.

It then outputs to everyone, Donation instructions.

So basically just a couple of lines

If someone could do this for me, I will be very greatful


Re: Need a little code for a /donateaccounce CMD - hanzen - 15.01.2011

Post whatever you started on so we can see your variables and command base.


Re: Need a little code for a /donateaccounce CMD - iiLiamii - 15.01.2011

Quote:
Originally Posted by hanzen
Посмотреть сообщение
Post whatever you started on so we can see your variables and command base.
I just deleted it bud, It has like 70 errors paha.

Would you be able to give me some code? A simple admin input, and all players output code?

I can edit the rest.


Re: Need a little code for a /donateaccounce CMD - Rokzlive - 15.01.2011

pawn Код:
COMMAND:donateannounce(playerid, params[])
{
    if(playerdata[playerid][level] >= 1)
    {
        SendClientMessageToAll(COLOR,"Donate blah blah blah");
        return 1;
    }
    else
    {
        return 0;
    }
}



Re: Need a little code for a /donateaccounce CMD - LiamM - 15.01.2011

I cant really do the admin system but the /donation thing is fairly easy, you just use ClientMessages mainly

I use zcmd so this is how it would be for me

Код:
COMMAND:donateannounce(playerid, params[])
{
     SendClientMessageToAll(COLOR THAT YOU WANT, "Feel free to donate to us to help the server keep on running and help us bring out new updates to make it even more funner!"); //Or a message like that

     return 1;
}



Re: Need a little code for a /donateaccounce CMD - hanzen - 15.01.2011

This is using strcmp. I'm not sure how you define your admins but that can easily be changed.
pawn Код:
if(!strcmp("/donateannounce", cmdtext, true))
    {
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, 0xFF0000AA, " you are not authorized to use that command!");
        SendClientMessageToAll(0xFFFFFFAA, "«» Donation announcement «»");
        SendClientMessageToAll(0xFFFFFFAA, "You can now purchase VIP features from the website.");
        SendClientMessageToAll(0xFFFFFFAA, "For a small amount you can get exclusive features.");
        return 1;
    }



Re: Need a little code for a /donateaccounce CMD - iiLiamii - 15.01.2011

Quote:
Originally Posted by hanzen
Посмотреть сообщение
This is using strcmp. I'm not sure how you define your admins but that can easily be changed.
pawn Код:
if(!strcmp("/donateannounce", cmdtext, true))
    {
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, 0xFF0000AA, " you are not authorized to use that command!");
        SendClientMessageToAll(0xFFFFFFAA, "«» Donation announcement «»");
        SendClientMessageToAll(0xFFFFFFAA, "You can now purchase VIP features from the website.");
        SendClientMessageToAll(0xFFFFFFAA, "For a small amount you can get exclusive features.");
        return 1;
    }
Thanks.

Quote:

0xFFFFFFAA

Is that a color Code Bud?


Re: Need a little code for a /donateaccounce CMD - hanzen - 15.01.2011

Yeah, it's white.


Re: Need a little code for a /donateaccounce CMD - iiLiamii - 15.01.2011

Ahh Sweet, Can I simply use RED In place of that? :P


Re: Need a little code for a /donateaccounce CMD - iiLiamii - 15.01.2011

Quote:
Originally Posted by hanzen
Посмотреть сообщение
This is using strcmp. I'm not sure how you define your admins but that can easily be changed.
pawn Код:
if(!strcmp("/donateannounce", cmdtext, true))
    {
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, 0xFF0000AA, " you are not authorized to use that command!");
        SendClientMessageToAll(0xFFFFFFAA, "«» Donation announcement «»");
        SendClientMessageToAll(0xFFFFFFAA, "You can now purchase VIP features from the website.");
        SendClientMessageToAll(0xFFFFFFAA, "For a small amount you can get exclusive features.");
        return 1;
    }
I get this error when compiling:

Quote:

C:\Users\Liam\Desktop\VortexRoleplay80A.pwn(6516) : error 049: invalid line continuation
C:\Users\Liam\Desktop\VortexRoleplay80A.pwn(6517) : error 055: start of function body without function header
C:\Users\Liam\Desktop\VortexRoleplay80A.pwn(6517) : error 010: invalid function or declaration
C:\Users\Liam\Desktop\VortexRoleplay80A.pwn(651 : error 010: invalid function or declaration
C:\Users\Liam\Desktop\VortexRoleplay80A.pwn(6522) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase