'Opet' ne daje score


Započeo Plen Ki Mun, Mart 21, 2018, 11:46:44 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Komanda ne daje igracu score to je ne postavlja na zadani broj, niÅ¡ta se ne dogaÄ'a. @Ino42O

Dio skripte:

CMD:setscore(playerid, params[])
{
	new string[128], pName[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], pID, score;
	
	if (PInfo[playerid][Admin] < 5) return SCM(playerid, -1"Nemozes to.");
	if(sscanf(params, "ud", pID, score)) return SCM(playerid, -1,"[USAGE]: {FFFFFF}/setscore <playerid> <score>");
	if(pID == INVALID_PLAYER_ID) return SCM(playerid, RED, "Igrac nije povezan");
	GetPlayerName(playerid, name, sizeof(name));
	GetPlayerName(pID, pName, sizeof(pName));
	format(string, sizeof(string), "[GIVE]: {FFFFFF}%s ti je postavi score na %d name, score);
	SCM(pID, COLOR_ADMIN, string);
	format(string, sizeof(string), "[GIVE]: {FFFFFF}Postavio si %d score za %s", score, pName);
	SCM(playerid, COLOR_ADMIN, string);
	
	SetPlayerScore(pID, score);
	return 1;
}


I ovdje ne daje igracu skor.

GivePlayerScore(captureZone[zoneid][E_CAPTURE_ZONE_ATTACKER], GetPlayerScore(captureZone[zoneid][E_CAPTURE_ZONE_ATTACKER]) + 2);


Kasnije sam dodao ovaj štok, ali nezz ima li potrebe za time

stock GivePlayerScore(playerid, score)
{
	SetPlayerScore(playerid, GetPlayerScore(playerid)+score);
 	return 1;
}


Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
Slika/video ingame problema(obavezno ako je ingame problem):

uradi debug
heroin rap - Moskri u kuci, od sledece lajne glava ce mi puci

Pokušaj ovo.

CMD:setscore(playerid, params[])
{
	new targetid, amount, string[100];

	if (PInfo[playerid][Admin] < 5)
		return SCM(playerid, -1, "Nemas dopustenje.");

	if (sscanf(params, "ud", targetid, amount))
		return SCM(playerid, -1, "/setscore ID Name");

	if (targetid == INVALID_PLAYER_ID)
		return SCM(playerid, -1, "ID igraca je nepostojeci.");

	format(string,sizeof(string),"Postavili ste %s's score na %d.", PInfo[targetid[pName], amount);
	SCM(targetid, -1, string);

	format(string,sizeof(string),"%s vam je postavio score na %d.", PInfo[playerid][pName], amount);
	SCM(playerid, -1, string);

	SetPlayerScore(playerid, amount);
	return 1;
}
Former Developer | COD: Lords Of War - Modern Warfare 3 | Stunt Planet | Global Warfare |

Nadji kako ti je definisan Score broj i kucas posle cmd SetPlayerScore(PlayerInfo[playerid][pScore] == %d,GetScore(ili definicija scora)

Eto,mozda bi trebalo da radi

Citat: Bolex_ poslato Mart 21, 2018, 15:32:18 POSLE PODNE
Pokušaj ovo.

CMD:setscore(playerid, params[])
{
	new targetid, amount, string[100];

	if (PInfo[playerid][Admin] < 5)
		return SCM(playerid, -1, "Nemas dopustenje.");

	if (sscanf(params, "ud", targetid, amount))
		return SCM(playerid, -1, "/setscore ID Name");

	if (targetid == INVALID_PLAYER_ID)
		return SCM(playerid, -1, "ID igraca je nepostojeci.");

	format(string,sizeof(string),"Postavili ste %s's score na %d.", PInfo[targetid[pName], amount);
	SCM(targetid, -1, string);

	format(string,sizeof(string),"%s vam je postavio score na %d.", PInfo[playerid][pName], amount);
	SCM(playerid, -1, string);

	SetPlayerScore(playerid, amount);
	return 1;
}


Hvala tbr.

Radi sada kako treba. <3

Citat: Bolex_ poslato Mart 21, 2018, 15:32:18 POSLE PODNE
Pokušaj ovo.

CMD:setscore(playerid, params[])
{
	new targetid, amount, string[100];

	if (PInfo[playerid][Admin] < 5)
		return SCM(playerid, -1, "Nemas dopustenje.");

	if (sscanf(params, "ud", targetid, amount))
		return SCM(playerid, -1, "/setscore ID Name");

	if (targetid == INVALID_PLAYER_ID)
		return SCM(playerid, -1, "ID igraca je nepostojeci.");

	format(string,sizeof(string),"Postavili ste %s's score na %d.", PInfo[targetid[pName], amount);
	SCM(targetid, -1, string);

	format(string,sizeof(string),"%s vam je postavio score na %d.", PInfo[playerid][pName], amount);
	SCM(playerid, -1, string);

	SetPlayerScore(playerid, amount);
	return 1;
}

Imas tu mali milion gresaka!

SetPlayerScore(playerid, amount);

u

SetPlayerScore(targetid, amount);

?
Software Developer

Komanda se koristi već godinama na server u mome signature, znao bih da ima problema  ;)
Former Developer | COD: Lords Of War - Modern Warfare 3 | Stunt Planet | Global Warfare |

Citat: Ino42O poslato Mart 21, 2018, 17:41:20 POSLE PODNE
SetPlayerScore(playerid, amount);

u

SetPlayerScore(targetid, amount);

?

Da ovo mora biti targetid inace ce setati igracu koji kuca komandu a ne zeljenom IDu.
HARD WORK BEATS TALENT

Testao sam komandu sa prijateljem ovo što je tbr bolex dao i radi mi okej.

Moze lock tu.  :)

cudna mi je ta komanda od bolexa lmao, al hj
heroin rap - Moskri u kuci, od sledece lajne glava ce mi puci