SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/11/2011, 03:34 PM   #1
seanny
High-roller
 
seanny's Avatar
 
Join Date: Oct 2010
Posts: 1,429
Reputation: 41
Question Can this be changed please, Thanks! (Rep+)

Hello, Everytime I attempt to change this, Faction 12 Cant use it even if I have

pawn Code:
if(!(PlayerInfo[playerid][pMember] >= 1 && PlayerInfo[playerid][pMember] <= 7 || PlayerInfo[playerid][pMember] == 12 ))

pawn Code:
if(strcmp(cmd, "/departments", true) == 0 || strcmp(cmd, "/d", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!(PlayerInfo[playerid][pMember] >= 1 && PlayerInfo[playerid][pMember] <= 7))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   You are not part of a Team !");
                return 1;
            }
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[256];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/d)epartments [department chat]");
                return 1;
            }
            format(string, sizeof(string), "** [%s] %s %s: %s **", GetPlayerFactionName(playerid),GetPlayerRank(playerid),PlayerName(playerid), result);
            SendFamilyMessage(1, COLOR_DCHAT, string);
            SendFamilyMessage(2, COLOR_DCHAT, string);
            SendFamilyMessage(3, COLOR_DCHAT, string);
            SendFamilyMessage(4, COLOR_DCHAT, string);
            SendFamilyMessage(5, COLOR_DCHAT, string);
            SendFamilyMessage(6, COLOR_DCHAT, string);
            SendFamilyMessage(7, COLOR_DCHAT, string);
            format(string, sizeof(string), "[Radio] %s", result);
            SetPlayerChatBubble(playerid,string,COLOR_WHITE,30.0,10000);
            format(string, sizeof(string), "Departments: %s %s %s: %s", GetPlayerFactionName(playerid),GetPlayerRank(playerid),PlayerName(playerid), result);
            Log("logs/departments.log", string);
            return 1;
        }
        return 1;
    }
__________________
I'm no longer part of the SA-MP scene. I will not respond to any support requests.
Developer @ Outlaw Games Studio
https://discord.gg/BR2FCTm
seanny is offline   Reply With Quote
Old 29/11/2011, 03:36 PM   #2
Kingunit
High-roller
 
Kingunit's Avatar
 
Join Date: Dec 2010
Location: The Netherlands
Posts: 1,426
Reputation: 120
Default Re: Can this be changed please, Thanks! (Rep+)

pawn Code:
if(strcmp(cmd, "/departments", true) == 0 || strcmp(cmd, "/d", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!(PlayerInfo[playerid][pMember] >= 1 && PlayerInfo[playerid][pMember] <= 7 && PlayerInfo[playerid][pMemeber] == 12))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   You are not part of a Team !");
                return 1;
            }
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[256];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/d)epartments [department chat]");
                return 1;
            }
            format(string, sizeof(string), "** [%s] %s %s: %s **", GetPlayerFactionName(playerid),GetPlayerRank(playerid),PlayerName(playerid), result);
            SendFamilyMessage(1, COLOR_DCHAT, string);
            SendFamilyMessage(2, COLOR_DCHAT, string);
            SendFamilyMessage(3, COLOR_DCHAT, string);
            SendFamilyMessage(4, COLOR_DCHAT, string);
            SendFamilyMessage(5, COLOR_DCHAT, string);
            SendFamilyMessage(6, COLOR_DCHAT, string);
            SendFamilyMessage(7, COLOR_DCHAT, string);
            format(string, sizeof(string), "[Radio] %s", result);
            SetPlayerChatBubble(playerid,string,COLOR_WHITE,30.0,10000);
            format(string, sizeof(string), "Departments: %s %s %s: %s", GetPlayerFactionName(playerid),GetPlayerRank(playerid),PlayerName(playerid), result);
            Log("logs/departments.log", string);
            return 1;
        }
        return 1;
    }
__________________
Kingunit is offline   Reply With Quote
Old 29/11/2011, 03:37 PM   #3
seanny
High-roller
 
seanny's Avatar
 
Join Date: Oct 2010
Posts: 1,429
Reputation: 41
Default Re: Can this be changed please, Thanks! (Rep+)

Thanks! Rep+'ed
__________________
I'm no longer part of the SA-MP scene. I will not respond to any support requests.
Developer @ Outlaw Games Studio
https://discord.gg/BR2FCTm
seanny is offline   Reply With Quote
Old 29/11/2011, 03:39 PM   #4
Kostas'
High-roller
 
Kostas''s Avatar
 
Join Date: Sep 2011
Location: Athens, Greece
Posts: 1,063
Reputation: 101
Default Re: Can this be changed please, Thanks! (Rep+)

Isn't like this?
pawn Code:
if (!PlayerInfo[playerid][pMember] >= 1 && PlayerInfo[playerid][pMember] <= 7 || PlayerInfo[playerid][pMember] == 12)
{
    // Rest Of Code

Edit: too late, Kingunit already answered it.
__________________
Knowledge:
  • HTML
  • Pascal
  • Visual Basic
  • Algorithm
    • Pseudocode
Kostas' is offline   Reply With Quote
Old 29/11/2011, 03:39 PM   #5
Kingunit
High-roller
 
Kingunit's Avatar
 
Join Date: Dec 2010
Location: The Netherlands
Posts: 1,426
Reputation: 120
Default Re: Can this be changed please, Thanks! (Rep+)

itsok goodluck with the script.
__________________
Kingunit is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can this be changed please, Thanks! seanny Scripting Help 2 26/11/2011 12:32 PM
Can this be changed please, Thanks! seanny Scripting Help 1 18/10/2011 08:24 PM
I changed the Sentence whatever i want but IG no thing Changed Jaber_Brown Help Archive 13 26/05/2010 02:30 PM
Changed to SA:MP Hot Help Archive 1 21/02/2010 09:18 PM
Need help to get the time not changed. DonTSHootMi Help Archive 1 08/09/2009 11:39 AM


All times are GMT. The time now is 07:14 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.