Need a little code for a /donateaccounce CMD
#1

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
Reply
#2

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

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.
Reply
#4

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

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;
}
Reply
#6

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;
    }
Reply
#7

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?
Reply
#8

Yeah, it's white.
Reply
#9

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

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

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)