Posts by Face9000

    Can someone tell me why this /weps command shows blank dialog instead of player's weapons?

    pawn Код:

    Code
    CMD:weps(playerid, params[]){    if (Player[playerid][Level] < 1)    {        return SendClientMessage(playerid, COLOR_TOMATO, You must be admin level 1+ to use this command.);    }    else    {        new pID, bool:all = isnull(params);        sscanf(params, U(-1), pID);        if(pID == INVALID_PLAYER_ID && !all) return SendClientMessage(playerid, COLOR_TOMATO, The specified player is not connected.);        else        {            new CountW,weapon[24];            static strTemp[220],strDest[220 char],strWeap[5500 char],weap[2][2];            if(all)            {                strWeap = !{00BBF6}Name\t{00BBF6}Weapon\t{00BBF6}Ammo\n;                foreach(new i : Player)                {                    GetPlayerWeaponData(i, 7, weap[0][0], weap[0][1]);                    GetPlayerWeaponData(i, 8, weap[1][0], weap[1][1]);                    strTemp[0] = EOS;                    //--------------------------------------------------------------                    if(WEAPON_ROCKETLAUNCHER <= weap[0][0] <= WEAPON_MINIGUN)                    {                        GetWeaponNameEx(weap[0][0], weapon);                        format(strTemp, sizeof(strTemp), {00FF00}%s {00BBF6}(ID:%d) \t{00FF00}%s \t{FF0000}%d\n, ReturnPlayerName(i), i, weapon, weap[0][1]),CountW++;                    }                    if(WEAPON_GRENADE <= weap[1][0] <= WEAPON_MOLTOV)                    {                        GetWeaponNameEx(weap[1][0], weapon);                        if(!strTemp[0]) format(strTemp, sizeof(strTemp), {00FF00}%s {00BBF6}(ID:%d) \t{00FF00}%s \t{FF0000}%d\n, ReturnPlayerName(i), i, weapon, weap[1][1]);                        else format(strTemp, sizeof(strTemp), %s{00FF00}%s {00BBF6}(ID:%d) \t{00FF00}%s \t{FF0000}%d\n, strTemp, ReturnPlayerName(i), i, weapon, weap[1][1]);                        CountW++;                    }                    if(strTemp[0])                    {                        strpack(strDest,strTemp);                        strcat(strWeap,strDest);                    }                }                if(!CountW) SendClientMessage(playerid, 0xFF000000, USAGE: {49FFFF}/weaps [ID/Name]);                else{                    strWeap{strlen(strWeap)-1} = EOS;                    ShowPlayerDialog(playerid, 123, DIALOG_WEPS, {BBFF00}Players with {00BBF6}Big Weapons, strWeap, Close, );                }            }            else            {                for(new i=0; i != 13; i++)                {                    GetPlayerWeaponData(pID, i, weap[0][0], weap[0][1]);                    if(weap[0][0] > 0 && weap[0][1] > 0)                        CountW++;                }                if(CountW < 1) SendClientMessage(playerid, 0x00FF0000, This player don't have Weapons!);                else{                    strWeap = !{00BBF6}Weapon\t{00BBF6}Ammo\n;                    for(new i=0; i != 13; i++)                    {                        GetPlayerWeaponData(pID, i, weap[0][0], weap[0][1]);                        if(weap[0][0] > 0 && weap[0][1] > 0)                        {                            GetWeaponNameEx(weap[0][0], weapon);                            if(weap[0][1] == 65535 || weap[0][1] == 1) format(strTemp, sizeof(strTemp), {00FF00}%s \t{FF0000}1\n,weapon);                            else format(strTemp, sizeof(strTemp), {00FF00}%s \t{FF0000}%d\n,weapon, weap[0][1]);                            strpack(strDest,strTemp);                            strcat(strWeap,strDest);                        }                    }                    strWeap{strlen(strWeap)-1} = EOS;                    format(strTemp, sizeof(strTemp), {BBFF00}%s's {00BBF6}Weapons:, ReturnPlayerName(pID)),                    ShowPlayerDialog(playerid, 123, DIALOG_WEPS, strTemp, strWeap, Close, );                }            }        }    }    return 1;}

    I have this code to create in automatic the map icons for gas pumps:

    pawn Код:

    Code
    CreateDynamicMapIcon([pumpX], PumpData[i][pumpY], PumpData[i][pumpZ], 55, 0, 0, .streamdistance = 2000.0);

    But when i compile, i get this:

    Quote:


    error 029: invalid expression, assumed zero
    warning 215: expression has no effect
    error 001: expected token: ;, but found ]
    error 029: invalid expression, assumed zero
    fatal error 107: too many error messages on one line

    What's wrong? And how to make this icons visibile even if a player is faaaar away from the gas pumps?

    Im getting argument mismatch at those lines:

    pawn Код:

    Code
    USA_CP_SHOP = CreateDynamicCP(-250.0965,2602.7275,62.8582,88.2492,3.0,-1,-1,-1,100.0);    GERMANY_CP_SHOP = CreateDynamicCP(-1478.7811,2640.7166,58.7879,0.4926,3.0,-1,-1,-1,100.0);    RUSSIA_CP_SHOP = CreateDynamicCP(-162.0187,1132.3522,19.7422,269.6302,3.0,-1,-1,-1,100.0);

    But the code seems ok. I already defined it.

    I have this dialog but seems too long and cant compile. I know i have to use strcat but idk how to do it with the DIALOG_STYLE_LIST

    pawn Код:

    Code
    CMD:obj(playerid){    if (Player[playerid][Vip] < 1)    {        ShowPlayerDialog(playerid,DIALOG_VIP_OBJECTS,DIALOG_STYLE_LIST,Hold Objects,SantaHat               \nParrot               \nParrot-Man               \nHippo               \nMotorCycleHelmet               \nCapBack                \nGlasses                \nSmokeFlare                \nSphere1                \nSphere2                \nSphere3                \nBalon               \nIron               \nAlien               \nIcread               \n{ffff12}Weaponaizer              \nRemove Hold Objects,Ok,Close);    }    return 1;}

    I have this coordinates:

    pawn Code:

    Code
    new Float: WepShop[MAX_WEP_SHOPS][e_shops] = {{-85.2422, -1165.0312, 2.6328},{-90.1406, -1176.6250, 2.6328},{-92.1016, -1161.7891, 2.9609},{1941.6562, -1778.4531, 14.1406}        {2645.2500, 1111.7500, 11.2500}};

    I wanna use CreateDynamicMapIcon to create a map icon on all this coordinates without repeating code. How?

    pawn Код:

    Code
    public OnLoginDate(extraid, username[]){    if (!IsPlayerConnected(extraid))        return 0;    static        rows,        fields,        date[36];    cache_get_value(rows, fields, g_SQL);    if (rows) {        cache_get_row_count(0, 0, date, g_SQL);        new buf[128];        format(buf, sizeof(buf), %s's last login was on: %s, username,date);        SendClientMessage(extraid,COLOR_RED, buf);    }    else {        SendClientMessage(extraid,COLOR_RED, Invalid username specified.);    }    return 1;}

    Same.

    Well, lucky me i still have my ooooooooooold game mp account so this problem doesn't affect me. However im sad for the new servers, without game-mp not accepting new accounts will be very hard to populate a new server nowdays. People will go eslewhere buying hosted tab paying 2x or even 3x original prices, and that's bad.

    I'm using Blueg's MYSql R41-2 and i have this code:

    pawn Код:

    Code
    public OnLoginDate(extraid, username[]){    if (!IsPlayerConnected(extraid))        return 0;    static        rows,        fields,        date[36];    cache_get_data(rows, fields, g_SQL);    if (rows) {        cache_get_row(0, 0, date, g_SQL);        new buf[128];        format(buf, sizeof(buf), %s's last login was on: %s, username,date);        SendClientMessage(extraid,COLOR_RED, buf);    }    else {        SendClientMessage(extraid,COLOR_RED, Invalid username specified.);    }    return 1;}

    That gives me:


    pawn Код:

    Code
    error 017: undefined symbol cache_get_dataerror 017: undefined symbol cache_get_row

    Also in this stock:

    pawn Код:

    Code
    stock SQL_ReturnEscaped(const string[]){    new        entry[256];    mysql_real_escape_string(string, entry, g_iHandle);    return entry;}

    Always undefined symbol mysql_real_escape_string.

    Logic_ where i should put that debug code?


    @Gamminx, im using the compact version of gangzones (gangzonesc.inc).
    I tried to remove it and i got this errors while compiling:

    warning 202: number of arguments does not match definition

    In this code:

    pawn Код:

    Code
    gCaptureZone[i][zone_Id] = GangZoneCreate(gCaptureZone[i][zone_Pos][0], gCaptureZone[i][zone_Pos][1], gCaptureZone[i][zone_Pos][2], gCaptureZone[i][zone_Pos][3], SET_ALPHA(gTeamData[gCaptureZone[i][zone_Owner]][team_Color], 100), 2.0);

    warning 202: number of arguments does not match definition, here:

    pawn Код:

    Code
    for(new i, j = sizeof(gCaptureZone); i < j; i++)    {        GangZoneShowForPlayer(playerid, gCaptureZone[i][zone_Id]);    }

    And...

    warning 209: function OnPlayerEnterDynamicCP should return a value

    pawn Код:

    Code
    public OnPlayerLeaveDynamicCP(playerid, checkpointid){    for (new i, j = sizeof(gCaptureZone); i < j; i++)    {        if (gCaptureZone[i][zone_CPId] == checkpointid)        {            if (gCaptureZone[i][zone_Attacker] != INVALID_PLAYER_ID)            {                if (GetPlayerTeam(playerid) == GetPlayerTeam(gCaptureZone[i][zone_Attacker]))                {                    gCaptureZone[i][zone_Players]--;                    if (! gCaptureZone[i][zone_Players])                    {                        SendClientMessage(playerid, 0xFF0000FF, You failed to capture the zone, there were no teammates left in your checkpoint.);                        GangZoneStopFlashForAll(gCaptureZone[i][zone_Id]);                        new buf[150];                        strcat(buf, ZONE: Team );                        strcat(buf, gTeamData[GetPlayerTeam(playerid)][team_Name]);                        strcat(buf,  failed to capture zone );                        strcat(buf, gCaptureZone[i][zone_Name]);                        strcat(buf,  against team );                        strcat(buf, gTeamData[gCaptureZone[i][zone_Owner]][team_Name]);                        strcat(buf, .);                        SendClientMessageToAll(0xFFFFFFFF, buf);                        gCaptureZone[i][zone_Attacker] = INVALID_PLAYER_ID;                        KillTimer(gCaptureZone[i][zone_Timer]);                    }                    else if (gCaptureZone[i][zone_Attacker] == playerid)                    {                        for (new p, l = GetPlayerPoolSize(); p <= l; p++)                        {                            if (GetPlayerTeam(p) == GetPlayerTeam(playerid))                            {                                if (IsPlayerInDynamicCP(p, checkpointid))                                {                                    gCaptureZone[i][zone_Attacker] = p;                                    break;                                }                            }                        }                    }                }                PlayerTextDrawHide(playerid, ptxtCapture[playerid]);                HidePlayerProgressBar(playerid, pbarCapture[playerid]);                break;            }        }    }}

    What's wrong with that line? How can that code block everything? However, this gTeamData array:

    Код:

    Code
    new const gTeamData[][e_TEAM_DATA] = { 	{Usa, TEAM_USA_COLOUR}, 	{Germany, TEAM_GERMANY_COLOUR}, 	{Russia, TEAM_RUSSIA_COLOUR} };

    And, i know it's from Gammix.

    No, the Capturing in 30 doesnt even show. I just got that message and nothing more. No progress bar, no capturing, no flash.

    This is OnZoneUpdate:

    Код:

    Code
    public  OnZoneUpdate(zoneid) { 	switch(gCaptureZone[zoneid][zone_Players]) 	{  		case 1: 		{ 			gCaptureZone[zoneid][zone_Tick][0] += 1; 			gCaptureZone[zoneid][zone_Tick][1] -= 1; 		}  		case 2: 		{ 			gCaptureZone[zoneid][zone_Tick][0] += 2; 			gCaptureZone[zoneid][zone_Tick][1] += 2; 		} 		default: 		{ 			gCaptureZone[zoneid][zone_Tick][0] += 3; 			gCaptureZone[zoneid][zone_Tick][1] += 2; 		} 	}  	for (new i, j = GetPlayerPoolSize(); i <= j; i++) 	{  		if (IsPlayerInDynamicCP(i, gCaptureZone[zoneid][zone_CPId]) && ! IsPlayerInAnyVehicle(i) && GetPlayerTeam(i) == GetPlayerTeam(gCaptureZone[zoneid][zone_Attacker])) // if the player is in CP, outside any vehicle and of same team that of attacker 		{ 			SetPlayerProgressBarValue(i, pbarCapture[i], gCaptureZone[zoneid][zone_Tick][0]);   		} 	}  	if (gCaptureZone[zoneid][zone_Tick][0] > CAPTURE_TIME) 	{ 		SendClientMessage(gCaptureZone[zoneid][zone_Attacker], 0x00FF00FF, You have successfully captured the zone, +3 score and +$3000.); 		SetPlayerScore(gCaptureZone[zoneid][zone_Attacker], GetPlayerScore(gCaptureZone[zoneid][zone_Attacker]) + 3); 		GivePlayerMoney(gCaptureZone[zoneid][zone_Attacker], 3000);  		for (new p, l = GetPlayerPoolSize(); p <= l; p++) 		{ 			if (IsPlayerInDynamicCP(p, gCaptureZone[zoneid][zone_CPId])) 			{ 				PlayerTextDrawHide(p, ptxtCapture[p]); 				HidePlayerProgressBar(p, pbarCapture[p]);  				if (p != gCaptureZone[zoneid][zone_Attacker] && GetPlayerTeam(p) == GetPlayerTeam(gCaptureZone[zoneid][zone_Attacker]) && ! IsPlayerInAnyVehicle(p)) 				{ 					SendClientMessage(p, 0x00FF00FF, You have assisted your teammate to capture the zone, +1 score and +$1500.); 					SetPlayerScore(p, GetPlayerScore(p) + 1); 					GivePlayerMoney(p, 1500); 				} 			} 		}   		GangZoneStopFlashForAll(gCaptureZone[zoneid][zone_Id]);  		GangZoneShowForAll(gCaptureZone[zoneid][zone_Id], SET_ALPHA(gTeamData[GetPlayerTeam(gCaptureZone[zoneid][zone_Attacker])][team_Color], 100));  		KillTimer(gCaptureZone[zoneid][zone_Timer]);  		new text[150]; 		strcat(text, ZONE: Team ); 		strcat(text, gTeamData[GetPlayerTeam(gCaptureZone[zoneid][zone_Attacker])][team_Name]); 		strcat(text,  has successfully captured the zone ); 		strcat(text, gCaptureZone[zoneid][zone_Name]); 		strcat(text,  against team ); 		strcat(text, gTeamData[gCaptureZone[zoneid][zone_Owner]][team_Name]); 		strcat(text, .); 		SendClientMessageToAll(0xFFFFFFFF, text);  		gCaptureZone[zoneid][zone_Owner] = GetPlayerTeam(gCaptureZone[zoneid][zone_Attacker]); 		gCaptureZone[zoneid][zone_Attacker] = INVALID_PLAYER_ID; 	} }

    This is the full OnPlayerEnterDynamicCp (which i get a warning when compiling because OnPlayerEnterDynamicCp should return a value..)

    Код:

    Code
    public OnPlayerEnterDynamicCP(playerid, checkpointid) { 	for (new i, j = sizeof(gCaptureZone); i < j; i++) 	{ 		if (gCaptureZone[i][zone_CPId] == checkpointid) 		{ 			new buf[150]; 			if (gCaptureZone[i][zone_Attacker] != INVALID_PLAYER_ID)    			{ 				if (GetPlayerTeam(playerid) == GetPlayerTeam(gCaptureZone[i][zone_Attacker])) 				{ 					if (IsPlayerInAnyVehicle(playerid)) 					{ 						return SendClientMessage(playerid, 0xFF0000FF, ERROR: You cannot capture the zone in a vehicle.); 					}  					format(buf, sizeof(buf), Capturing in %i..., gCaptureZone[i][zone_Tick][1]); 					PlayerTextDrawSetString(playerid, ptxtCapture[playerid], buf); 					PlayerTextDrawShow(playerid, ptxtCapture[playerid]);  				 	SetPlayerProgressBarValue(playerid, pbarCapture[playerid], gCaptureZone[i][zone_Tick][0]); 					ShowPlayerProgressBar(playerid, pbarCapture[playerid]);  					gCaptureZone[i][zone_Players]++;   					SendClientMessage(playerid, 0x00FF00FF, Stay in the checkpoint to assist your teammate in capturing the zone.); 				} 			} 			else 			{  				if (GetPlayerTeam(playerid) != gCaptureZone[i][zone_Owner]) 				{ 					if (IsPlayerInAnyVehicle(playerid)) 					{ 						return SendClientMessage(playerid, 0xFF0000FF, ERROR: You cannot capture the zone in a vehicle.); 					}  					buf[0] = EOS; 					strcat(buf, The zone is controlled by team ); 					strcat(buf, gTeamData[gCaptureZone[i][zone_Owner]][team_Name]); 					strcat(buf, .); 					SendClientMessage(playerid, 0x00FF00FF, buf); 					SendClientMessage(playerid, 0x00FF00FF, Stay in the checkpoint for #CAPTURE_TIME seconds to capture the zone.);  					GangZoneFlashForAll(gCaptureZone[i][zone_Id], SET_ALPHA(gTeamData[GetPlayerTeam(playerid)][team_Color], 100));  					gCaptureZone[i][zone_Attacker] = playerid; 					gCaptureZone[i][zone_Players] = 1; 					gCaptureZone[i][zone_Tick][0] = 0; 					gCaptureZone[i][zone_Tick][1]= CAPTURE_TIME;  					KillTimer(gCaptureZone[i][zone_Timer]); 					gCaptureZone[i][zone_Timer] = SetTimerEx(OnZoneUpdate, 1000, true, i, i);   					buf[0] = EOS; 					strcat(buf, ZONE: Team ); 					strcat(buf, gTeamData[GetPlayerTeam(playerid)][team_Name]); 					strcat(buf,  is trying to capture zone ); 					strcat(buf, gCaptureZone[i][zone_Name]); 					strcat(buf,  against team ); 					strcat(buf, gTeamData[gCaptureZone[i][zone_Owner]][team_Name]); 					strcat(buf, .); 					SendClientMessageToAll(0xFFFFFFFF, buf);  					PlayerTextDrawSetString(playerid, ptxtCapture[playerid], Capturing in 30...); 					PlayerTextDrawShow(playerid, ptxtCapture[playerid]);  				 	SetPlayerProgressBarValue(playerid, pbarCapture[playerid], gCaptureZone[i][zone_Tick][0]); 					ShowPlayerProgressBar(playerid, pbarCapture[playerid]); 				} 			} 			break; 		} 	} }

    I made a gangzone system thanks to Gammix's tutoril and i'm testing it a bit. When i enter the gangzone cp to start taking over, i get just the message The zone is controlled by ... stay in cp for 30 seconds and nothing happens. As you see, after this message, the gangzone should start flash and timer have to start, but nothing:

    Код:

    Code
    if (GetPlayerTeam(playerid) != gCaptureZone[i][zone_Owner]) 				{ 					if (IsPlayerInAnyVehicle(playerid)) 					{ 						return SendClientMessage(playerid, 0xFF0000FF, ERROR: You cannot capture the zone in a vehicle.); 					}  					buf[0] = EOS; 					strcat(buf, The zone is controlled by team ); 					strcat(buf, gTeamData[gCaptureZone[i][zone_Owner]][team_Name]); 					strcat(buf, .); 					SendClientMessage(playerid, 0x00FF00FF, buf); 					SendClientMessage(playerid, 0x00FF00FF, Stay in the checkpoint for #CAPTURE_TIME seconds to capture the zone.);  					GangZoneFlashForAll(gCaptureZone[i][zone_Id], SET_ALPHA(gTeamData[GetPlayerTeam(playerid)][team_Color], 100));  					gCaptureZone[i][zone_Attacker] = playerid; 					gCaptureZone[i][zone_Players] = 1; 					gCaptureZone[i][zone_Tick][0] = 0; 					gCaptureZone[i][zone_Tick][1]= CAPTURE_TIME;  					KillTimer(gCaptureZone[i][zone_Timer]); 					gCaptureZone[i][zone_Timer] = SetTimerEx(OnZoneUpdate, 1000, true, i, i);   					buf[0] = EOS; 					strcat(buf, ZONE: Team ); 					strcat(buf, gTeamData[GetPlayerTeam(playerid)][team_Name]); 					strcat(buf,  is trying to capture zone ); 					strcat(buf, gCaptureZone[i][zone_Name]); 					strcat(buf,  against team ); 					strcat(buf, gTeamData[gCaptureZone[i][zone_Owner]][team_Name]); 					strcat(buf, .); 					SendClientMessageToAll(0xFFFFFFFF, buf);  					PlayerTextDrawSetString(playerid, ptxtCapture[playerid], Capturing in 30...); 					PlayerTextDrawShow(playerid, ptxtCapture[playerid]);  				 	SetPlayerProgressBarValue(playerid, pbarCapture[playerid], gCaptureZone[i][zone_Tick][0]); 					ShowPlayerProgressBar(playerid, pbarCapture[playerid]); 				}

    Seems the code breaks after the message..