CMD Mark Player Position on Setteam
#1

Hey , i need help ,
how to add cmd /mark , to setteam script ,
example : my friends in LS ammuniton location , and i`m same setteam with my friends , and my friends type /mark , and friends position showing to teamchat , with this icon
on map , how to do that ? , that icon just showing for same setteam only in teamchat
This is setteam script
pawn Код:
#include <a_samp>
#include <zcmd>
#include <dini>
#include <sscanf>

// COLORS
#define usage 0xFFEEC1AA
#define error 0xFF3434AA
#define lancar 0x34C6FFAA

// DEFINES
#define version_team_chooser        "1.0"

enum LData
{
    Team
};

new TeamInfo[MAX_PLAYERS][LData];
new LGDTeam[MAX_PLAYERS];


public OnFilterScriptInit()
{
    print("\n----------------------------------------------------");
    print(" Team Chooser from leingod"#version_team_chooser"");
    print("----------------------------------------------------\n");
    return 1;
}

public OnPlayerConnect(playerid)
{
    new LName[MAX_PLAYER_NAME], file[128];
    GetPlayerName(playerid,LName,sizeof(LName));
    format(file,sizeof(file),"Teams/%s.ini",LName);
    if(!dini_Exists(file))
    {
        dini_Create(file);
        dini_IntSet(file,"Team",TeamInfo[playerid][Team]);
        new rteam = random(-999999999999);
        LGDTeam[playerid] = rteam;
    }
    if(dini_Exists(file))
    {
        TeamInfo[playerid][Team] = dini_Int(file,"Team");
        LGDTeam[playerid] = dini_Int(file,"Team");
    }
    return 1;
}


// ZCMD COMMANDS
COMMAND:setteam(playerid, params[])
{
    new LTeam;
    #pragma unused params
    if(sscanf(params, "d", LTeam)) return SendClientMessage(playerid, usage, "[USAGE]: /setteam [1-999,999]");
    else if (LTeam >= 999999 || LTeam == 0) return SendClientMessage(playerid, error, "[ERROR]: Team id must between 1 and 999,999");
    else
    {
        new string[128], LName[MAX_PLAYER_NAME], file[128];
        format(string, sizeof(string), "[SERVER]: Success choosing team id -> '%d'.", LTeam);
        SendClientMessage(playerid, lancar, string);
        LGDTeam[playerid] = LTeam;
        SetPlayerTeam(playerid, LGDTeam[playerid]);
        SetPlayerTeam(playerid, LTeam);
        GetPlayerName(playerid,LName,sizeof(LName));
        format(file,sizeof(file),"Teams/%s.ini",LName);
        dini_IntSet(file,"Team",LGDTeam[playerid]);
    }
    return 1;
}

COMMAND:myteam(playerid, params[])
{
    new str[256];
    #pragma unused params
    format(str, sizeof(str), "[SERVER]: Your team id -> '%d'.", LGDTeam);
    SendClientMessage(playerid, lancar, str);
    return 1;
}

COMMAND:resetteam(playerid, params[])
{
    new rteam = random(-999999999999), LName[MAX_PLAYER_NAME], file[128];
    #pragma unused params
    LGDTeam[playerid] = rteam;
    SetPlayerTeam(playerid, LGDTeam[playerid]);
    SendClientMessage(playerid, usage, "[SERVER]: Success make your team to netral, Everybody are enemy!.");
    GetPlayerName(playerid,LName,sizeof(LName));
    format(file,sizeof(file),"Teams/%s.ini",LName);
    dini_IntSet(file,"Team",LGDTeam[playerid]);
    return 1;
}

public OnPlayerText(playerid, text[])
{
    if(text[0] == '!'){
    new pn[MAX_PLAYER_NAME],m[128];
    GetPlayerName(playerid,pn,sizeof(pn));
    strdel(text,0,1);
    format(m,sizeof(m),"{00FFFF}[TEAMCHAT] %s [%i]: %s",pn,playerid,text);
    for(new i = 0; i < MAX_PLAYERS; i++){
    if(IsPlayerConnected(i)){
    if(LGDTeam[i] == LGDTeam[playerid]){
    SendClientMessage(i,0xFFFFFFFF,m);
    }
    }
    }
    return 0;
    }
    else return 1;
}
sorry for bad english
Reply
#2

You can't multi icon. SA-MP not support it
Reply
#3

i mean like this icon
Reply
#4

Try this
Код:
COMMAND:showteam(playerid, params[])
{
    new giveplayerid;
    #pragma unused params
    if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, usage, "[USAGE]: /showteam [playerid]");
    if(!IsPlayerConnected(giveplayerid)) {
		return SendClientMessage(playerid, COLOR_GRAD2, "Player invalid.");
   }
    else
    {
         new Float:plocx,Float:plocy,Float:plocz;
	 GetPlayerPos(giveplayerid, plocx, plocy, plocz);
         CreateDynamicMapIcon(plocx, plocy,  plocz, 56, 0, 0, 0, -1, 500.0);
         SendClientMessage(playerid, COLOR_YELLOW, "Player showing on you radar.");
    }
    return 1;
}


COMMAND:mark(playerid, params[])
{
   #pragma unused params
   if(LGDTeam[playerid] != 0)
    {
        new str[256];
        new Float:plocx,Float:plocy,Float:plocz;
        GetPlayerPos(playerid, plocx, plocy, plocz);
        for(new i = 0; i < MAX_PLAYERS; i++){
        if(IsPlayerConnected(i)){
        if(LGDTeam[i] == LGDTeam[playerid])
        {
        CreateDynamicMapIcon(plocx, plocy,  plocz, 56, 0, 0, 0, -1, 500.0);
        format(str, sizeof(str), "[SERVER]: Team Player %s mark on radar .", GetPlayerNameEx(playerid));
        SendClientMessage(i, lancar, str);
        return 1;
    }
    }
    }
}
Reply
#5

I have an eror
pawn Код:
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\Team.pwn(175) : error 017: undefined symbol "COLOR_GRAD2"
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\Team.pwn(180) : warning 217: loose indentation
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\Team.pwn(181) : warning 217: loose indentation
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\Team.pwn(181) : error 017: undefined symbol "CreateDynamicMapIcon"
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\Team.pwn(182) : error 017: undefined symbol "COLOR_YELLOW"
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\Team.pwn(200) : error 017: undefined symbol "CreateDynamicMapIcon"
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\Team.pwn(201) : error 017: undefined symbol "GetPlayerNameEx"
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\Team.pwn(208) : error 030: compound statement not closed at the end of file (started at line 191)
this on line 191
pawn Код:
if(LGDTeam[playerid] != 0)
Reply
#6

Add code
Код:
#include <streamer>

#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_YELLOW 0xFFFF00AA

stock GetPlayerNameExt(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	return name;
}
Reply
#7

Quote:
Originally Posted by niconhan
Посмотреть сообщение
Add code
Код:
#include <streamer>

#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_YELLOW 0xFFFF00AA

stock GetPlayerNameExt(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	return name;
}
an eror again
pawn Код:
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\Team.pwn(210) : error 017: undefined symbol "GetPlayerNameEx"
C:\DOCUME~1\user\Desktop\Server\PARADI~1\FILTER~1\Team.pwn(217) : error 030: compound statement not closed at the end of file (started at line 200)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#8

Place stock GetPlayerNameExt(playerid) over you command
Reply
#9

still eror
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)