Command /invite
#1

Whatever you are a medic or working in san news when you wrote command /invite you anyway will be invited to the police work .. I think there is a mistake in the last line. Maybe anybody can help how to fix it?

Код:
CMD:invite(playerid, params[])
{
	new targetid;
	new string[128];
	if(!PlayerInfo[playerid][Leader]) return SCM(playerid, COLOR_GREEN, "{AF1C1C}(INFO):{FFFFFF}Access Denied.");
    if(sscanf(params,"u", targetid))return SendClientMessage(playerid, COLOR_GREEN, "{E5AC00}(INFO):{FFFFFF}USAGE: /invite [playerid]");
    format(string, sizeof(string), "{E5AC00}(INFO):{FFFFFF}Leader %s has invited you to join his Faction. (Use '/accept Faction' to join the Faction)", RUS(playerid));
	SendClientMessage(targetid, COLOR_GREEN, string);
	format(string, sizeof(string), "{E5AC00}(INFO):{FFFFFF}You have invited %s to join your Faction.", RUS(targetid));
	SendClientMessage(playerid, COLOR_GREEN, string);
    PlayerInfo[targetid][PendingInv] = 0;
	return 1;
}
Reply
#2

pawn Код:
CMD:invite(playerid, params[])
{
    if (PlayerInfo[playerid][pLeader] >= 1)
    {
        new string[128], ftext[50], giveplayerid;
        if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /invite [playerid]");

        if(IsPlayerConnected(giveplayerid))
        {
            if (PlayerInfo[giveplayerid][pLeader] == 0 && PlayerInfo[giveplayerid][pMember] == 0 && PlayerInfo[giveplayerid][pFMember] == 255)
            {
                if(PlayerInfo[playerid][pLeader] == 1) { ftext = "Police"; }
                else if(PlayerInfo[playerid][pLeader] == 2) { ftext = "Medic"; }
                else if(PlayerInfo[playerid][pLeader] == 3) { ftext = "SANews"; }
                else { return 1; }
                InviteOffer[giveplayerid] = playerid;
                InviteFamily[giveplayerid] = 255;
                InviteFaction[giveplayerid] = PlayerInfo[playerid][pLeader];
                format(string, sizeof(string), "You have been invited to join the %s by %s - type /accept faction.", ftext, GetPlayerNameEx(playerid));
                SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
                format(string, sizeof(string), "You have invited %s to join the %s.", GetPlayerNameEx(giveplayerid),ftext);
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_GREY, "The player you're trying to invite is already in another faction or family.");
                return 1;
            }

        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only leaders can do this.");
    }
    return 1;
}
Reply
#3

C:\Users\WIN7\Desktop\Naujas aplankas (2)\gamemodes\roleplay.pwn(5851) : error 017: undefined symbol "InviteOffer"
C:\Users\WIN7\Desktop\Naujas aplankas (2)\gamemodes\roleplay.pwn(5851) : warning 215: expression has no effect
C:\Users\WIN7\Desktop\Naujas aplankas (2)\gamemodes\roleplay.pwn(5851) : error 001: expected token: ";", but found "]"
C:\Users\WIN7\Desktop\Naujas aplankas (2)\gamemodes\roleplay.pwn(5851) : error 029: invalid expression, assumed zero
C:\Users\WIN7\Desktop\Naujas aplankas (2)\gamemodes\roleplay.pwn(5851) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#4

/accept command if you need it
Код:
CMD:accept(playerid, params[])
{
	new targetid;
 	if(sscanf(params,"u", targetid))return SendClientMessage(playerid, COLOR_GREEN, "{E5AC00}(INFO):{FFFFFF}USAGE: /accept [faction |  gang | more to be added]");
    else if(!strcmp(params, "faction", true))
	{
		new string[128];
		if(PlayerInfo[playerid][PendingInv] == 0) return SendClientMessage(playerid, COLOR_GREEN, "{AF1C1C}(INFO):{FFFFFF}Nobody invited you to join a faction.");
		PlayerInfo[playerid][FactionID] = PlayerInfo[playerid][PendingInv];
		PlayerInfo[playerid][FactionRank] = 1;
		PlayerInfo[playerid][Faction] = 1;
        if(PlayerInfo[playerid][FactionID] == 1)
	    {
	        format(string, sizeof(string), "{E5AC00}(INFO):{FFFFFF}%s has accepted to join {E5AC00}Bone County Sheriff's Department.", RUS(playerid));
	        SendFM(playerid, COLOR_GREEN, string);
	    }
        else if(PlayerInfo[playerid][FactionID] == 2)
	    {
	        format(string, sizeof(string), "{E5AC00}(INFO):{FFFFFF}%s has accepted to join {E5AC00}Fort Carson Medical Department.", RUS(playerid));
	        SendFM(playerid, COLOR_GREEN, string);
        }
        else if(PlayerInfo[playerid][FactionID] == 3)
	    {
	        format(string, sizeof(string), "{E5AC00}(INFO):{FFFFFF}%s has accepted to join {E5AC00}City Council.", RUS(playerid));
	        SendFM(playerid, COLOR_GREEN, string);
        }
        else if(PlayerInfo[playerid][FactionID] == 4)
	    {
	        format(string, sizeof(string), "{E5AC00}(INFO):{FFFFFF}%s has accepted to join {E5AC00}Army Forces.", RUS(playerid));
	        SendFM(playerid, COLOR_GREEN, string);
        }
        else if(PlayerInfo[playerid][FactionID] == 5)
	    {
	        format(string, sizeof(string), "{E5AC00}(INFO):{FFFFFF}%s has accepted to join {E5AC00}News Agency.", RUS(playerid));
	        SendFM(playerid, COLOR_GREEN, string);
        }
    }
    else if(!strcmp(params, "family", true))
	{
		new string[128];
		if(PlayerInfo[playerid][PendingFInv] == 0) return SendClientMessage(playerid, COLOR_GREEN, "{AF1C1C}(INFO):{FFFFFF}Nobody invited you to join a Family.");
		PlayerInfo[playerid][FamilyID] = PlayerInfo[playerid][PendingFInv];
		PlayerInfo[playerid][FamilyRank] = 1;
		PlayerInfo[playerid][Family] = 1;
        if(PlayerInfo[playerid][FamilyID] == 1)
	    {
	        format(string, sizeof(string), "{E5AC00}(INFO):{FFFFFF}%s has accepted to join {E5AC00}Fort Carson Mechanics.", RUS(playerid));
	        Sendfamily(playerid, COLOR_GREEN, string);
	    }
        else if(PlayerInfo[playerid][FamilyID] == 2)
	    {
	        format(string, sizeof(string), "{E5AC00}(INFO):{FFFFFF}%s has accepted to join {E5AC00}Motorcycle Club.", RUS(playerid));
	        Sendfamily(playerid, COLOR_GREEN, string);
        }
        else if(PlayerInfo[playerid][FamilyID] == 3)
	    {
	        format(string, sizeof(string), "{E5AC00}(INFO):{FFFFFF}%s has accepted to join {E5AC00}Aviation Authority.", RUS(playerid));
	        Sendfamily(playerid, COLOR_GREEN, string);
        }
    }
	return 1;
}
Reply
#5

Someone.. Please
Reply
#6

what is line (5851)
Reply
#7

InviteOffer[giveplayerid] = playerid; this one
Reply
#8

Please
Reply
#9

pawn Код:
new InviteOffer[MAX_PLAYERS];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)