[Pomoć] Šalje po dva puta isti SCM

Započeo Vegas., April 06, 2012, 12:06:49 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Vegas.

Skripta koju koristim: Division
Detaljan opis problema: Kada kucam /aduty šalje dva puta isti SCM, neznam u čemu je problem..
Dio skripte: Evo je komanda
if(!strcmp(cmdtext, "/adminduty", true) || !strcmp(cmdtext, "/aduty", true)) // By Ellis
	{
		if(IsPlayerConnected(playerid))
		{
		    if(gPlayerLogged[playerid] == 0)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "   Morate se prvo prijaviti !");
				return 1;
		    }
		    if(PlayerInfo[playerid][pAdmin] > 0)
		    {
		        if(AdminDuty[playerid] == 0)
		        {
		            AdminDuty[playerid] = 1;
		            SetPlayerArmour(playerid, 100);
					SetPlayerHealth(playerid, 100);
					SetPlayerColor(playerid,TEAM_VAGOS_COLOR);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "{F3FF02}Admin {FFFFFF}%s(ID:%d) {F3FF02}je na duznosti, za pomoc kucajte {FFFFFF}/pomoc.", sendername,playerid);
					ABroadCast(COLOR_LIGHTRED,string,1);
                    DutyLabel[playerid] = Create3DTextLabel("{ff0000}Na duznosti!\n Ne ometaj!",0xFF000099,0,0,0,50,-1,1);
					Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0.6);
					SetPlayerSkin(playerid, 113);
					if(PlayerInfo[playerid][pAdmin] >= 1337)
					{
					    for(new i = 0; i < sizeof(CarInfo); i++)
						{
							SetVehicleParamsForPlayer(i,playerid,0,0);
						}
					}
					return 1;
		        }
		        else if(AdminDuty[playerid] == 1)
		        {
                    Delete3DTextLabel(DutyLabel[playerid]);
					AdminDuty[playerid] = 0;
		            SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerColor(playerid,TEAM_HIT_COLOR);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "{F3FF02}Admin {FFFFFF}%s(ID:%d) {F3FF02}vise nije na duznosti.", sendername,playerid);
                    new stariskin = PlayerInfo[playerid][pChar];
					SetPlayerSkin(playerid, stariskin);
					ABroadCast(COLOR_LIGHTRED,string,1);
					return 1;
		        }
		    }
		    else
		    {
		        SendClientMessage(playerid, COLOR_GREY, "   Niste Admin !");
		        return 1;
		    }
		}
	    return 1;
	}

Neke slike/video za lakse dobivanje pomoci(neobavezno):

Probaj si maknut' GameMastera pa napiši /adminduty.


ABroadCast(COLOR_LIGHTRED,string,1); ?
Å ta je to ,  zasto ne koristiÅ¡ SendClientMessageToAll  :D

_________________
176.31.192.105:7779

Vegas.

Slučajno :S sry..
Poslednja Izmena: April 06, 2012, 12:30:28 POSLE PODNE od Vegas.

Vegas.

@ DonWade To je slično..

@Chuck, hvala brate radi..

Možete mi pomoći oko ovog warna nekontam ga... 
C:\Documents and Settings\Vegas\Desktop\Xeptic RolePlay\Xeptic RolePlay\gamemodes\xeptic.pwn(3529) : warning 213: tag mismatch


Linija
if(namestring == -1 && !strcmp(plname, "Vegas.") == 0) // ovde baca warn
	if(namestring == -1 && !strcmp(plname, "Toni") == 0)

Citat: Vegas. poslato April 06, 2012, 12:30:07 POSLE PODNE
@ DonWade To je slično..

@Chuck, hvala brate radi..

Možete mi pomoći oko ovog warna nekontam ga... 
C:\Documents and Settings\Vegas\Desktop\Xeptic RolePlay\Xeptic RolePlay\gamemodes\xeptic.pwn(3529) : warning 213: tag mismatch


Linija
if(namestring == -1 && !strcmp(plname, "Vegas.") == 0) // ovde baca warn
	if(namestring == -1 && !strcmp(plname, "Toni") == 0)



Probaj staviti: if(namestring == -1 && !strcmp(plname, "Vegas") == 0)

Jer izgleda da ga "." jebe..

Daj još par linija ispod i iznad za taj warning.

Last nick: Paradox

Vegas.

Evo
public OnPlayerConnect(playerid)
{

	new plname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, plname, sizeof(plname));
	if(Security != 0)
	{
	    SendClientMessage(playerid, COLOR_YELLOW, "Host has broken one of the Agreement rules, action has been taken.");
	    Kick(playerid);
	    return 1;
	}
    new namestring = strfind(plname, "_", true);
	if(namestring == -1 && !strcmp(plname, "Vegas.") == 0)
	if(namestring == -1 && !strcmp(plname, "Toni") == 0)
	{
		SendClientMessage(playerid, COLOR_YELLOW2, "{0F629F}[DV] {F81414}Vase ime nije prihvatljivo.");
		SendClientMessage(playerid, COLOR_YELLOW2, "{0F629F}[DV] {F81414}Vase ime mora biti u formatu {FFFFFF}Ime_Prezime.");
		Kick(playerid);
		return 1;
	}

	RobbingTime[playerid] = 0;
	PlayerInfo[playerid][pRobTime] = 0;
	PlayerInfo[playerid][pKredit1] = 0;
	Delete3DTextLabel(DutyLabel[playerid]);
    Delete3DTextLabel(GMDutyLabel[playerid]);
	RemoveBuildingForPlayer(playerid, 6130, 1117.5859, -1490.0078, 32.7188, 0.25);
    RemoveBuildingForPlayer(playerid, 6255, 1117.5859, -1490.0078, 32.7188, 0.25);
	gActivePlayers[playerid]++;
	numplayers++;

Ovaj dio:
if(namestring == -1 && !strcmp(plname, "Vegas.") == 0)
if(namestring == -1 && !strcmp(plname, "Toni") == 0)
{
	SendClientMessage(playerid, COLOR_YELLOW2, "{0F629F}[DV] {F81414}Vase ime nije prihvatljivo.");
	SendClientMessage(playerid, COLOR_YELLOW2, "{0F629F}[DV] {F81414}Vase ime mora biti u formatu {FFFFFF}Ime_Prezime.");
	Kick(playerid);
	return 1;
}


Treba izgledati ovako:
if((namestring == -1 && !strcmp(plname, "Vegas.") == 0) || (namestring == -1 && !strcmp(plname, "Toni") == 0))
{
	SendClientMessage(playerid, COLOR_YELLOW2, "{0F629F}[DV] {F81414}Vase ime nije prihvatljivo.");
	SendClientMessage(playerid, COLOR_YELLOW2, "{0F629F}[DV] {F81414}Vase ime mora biti u formatu {FFFFFF}Ime_Prezime.");
	Kick(playerid);
	return 1;
}


Last nick: Paradox

Vegas.

Sada 2 ista warna na toj liniji  Tag Mistach kako već..
if((namestring == -1 && !strcmp(plname, "Vegas.") == 0) || (namestring == -1 && !strcmp(plname, "Toni") == 0))

Tu liniju zamijeni sa ovom:
if((namestring == -1 && strcmp(plname, "Vegas.") == 0) || (namestring == -1 && strcmp(plname, "Toni") == 0))

Last nick: Paradox

Vegas.

Hvala brate radi, a možeš mi objasniti značaj ovog warna i kako ga rješit, da ne bih otvarao teme ubuduće zbog jednog warna..

Malo teže je objasniti taj warning. I nije uvijek isti. Uglavnom, u PAWN-u postoje tagovi (npr. float, text, bool, ...) i sad npr. ako pokušavaš smjestiti neki text u varijablu koja ima float tag onda će ti se javiti taj warning.

Nadam se bar da si djelomično skužio što želim reći.

Last nick: Paradox