SA-MP Forums Archive
Can anyone help me and explain to me - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Can anyone help me and explain to me (/showthread.php?tid=236694)



Delete please - ElChapoGuzman - 08.03.2011

delete this please i dont need anymore


Re: Can anyone help me and explain to me - admantis - 08.03.2011

just say it here


Re: Can anyone help me and explain to me - ElChapoGuzman - 08.03.2011

Quote:
Originally Posted by admantis
Посмотреть сообщение
just say it here
i need them to explain to me


Re: Can anyone help me and explain to me - TheYoungCapone - 08.03.2011

Quote:
Originally Posted by ElChapoGuzman
Посмотреть сообщение
i need them to explain to me
what do they need to explain to you.


Re: Can anyone help me and explain to me - ElChapoGuzman - 08.03.2011

Quote:
Originally Posted by TheYoungCapone
Посмотреть сообщение
what do they need to explain to you.
how to do it so next time i can know how to do it and to learn more about pawno because its complicated for beginners but for pro scripters its easy


Re: Can anyone help me and explain to me - TheYoungCapone - 08.03.2011

Quote:
Originally Posted by ElChapoGuzman
Посмотреть сообщение
how to do it so next time i can know how to do it and to learn more about pawno because its complicated for beginners but for pro scripters its easy
how to do what? Do you have a specific question?


Re: Can anyone help me and explain to me - Libra_PL - 08.03.2011

Код:
dcmd_getplayermoney(playerid,params[])
{
	new playerid2, string[128];
	if(!sscanf(params, "u", playerid2))
	{
       	if(IsPlayerConnected(playerid2))
       	{
       		format(string, sizeof(string),"Player %s (ID %d) has got %s money!", GetName(playerid2), playerid2, GetPlayerMoney(playerid2));
			SendClientMessage(playerid,0x33FF33AA,string);
       	}
       	else return SendClientMessage(playerid,red,"ERROR: Player is not connected!");
   	}
   	else return SendClientMessage(playerid,red,"USAGE: /getplayermoney [playerid]");
	return 1;
}
Is that what you mean? This one is with sscanf... and dcmd (I think you can change to strcmp or zcmd if you want). And stock for GetName:

Код:
stock GetName(playerid)
{
    new name[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
		GetPlayerName(playerid, name, sizeof(name));
	}
	else
	{
	    name = "Unknown";
	}
	return name;
}



Re: Can anyone help me and explain to me - ElChapoGuzman - 08.03.2011

Quote:
Originally Posted by Libra_PL
Посмотреть сообщение
Код:
dcmd_getplayermoney(playerid,params[])
{
	new playerid2, string[128];
	if(!sscanf(params, "u", playerid2))
	{
       	if(IsPlayerConnected(playerid2))
       	{
       		format(string, sizeof(string),"Player %s (ID %d) has got %s money!", GetName(playerid2), playerid2, GetPlayerMoney(playerid2));
			SendClientMessage(playerid,0x33FF33AA,string);
       	}
       	else return SendClientMessage(playerid,red,"ERROR: Player is not connected!");
   	}
   	else return SendClientMessage(playerid,red,"USAGE: /getplayermoney [playerid]");
	return 1;
}
Is that what you mean? This one is with sscanf... and dcmd (I think you can change to strcmp or zcmd if you want). And stock for GetName:

Код:
stock GetName(playerid)
{
    new name[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
		GetPlayerName(playerid, name, sizeof(name));
	}
	else
	{
	    name = "Unknown";
	}
	return name;
}
YES EXACTLY BUT I NEED SOMEONE TO EXPLAIN AND CAN ANYONE CONVERT THIS TO STRCMP FOR ME PLEASE BUT YES THANKS ALOT MAN


Re: Can anyone help me and explain to me - admantis - 08.03.2011

Quote:
Originally Posted by Libra_PL
Посмотреть сообщение
Код:
dcmd_getplayermoney(playerid,params[])
{
	new playerid2, string[128];
	if(!sscanf(params, "u", playerid2))
	{
       	if(IsPlayerConnected(playerid2))
       	{
       		format(string, sizeof(string),"Player %s (ID %d) has got %s money!", GetName(playerid2), playerid2, GetPlayerMoney(playerid2));
			SendClientMessage(playerid,0x33FF33AA,string);
       	}
       	else return SendClientMessage(playerid,red,"ERROR: Player is not connected!");
   	}
   	else return SendClientMessage(playerid,red,"USAGE: /getplayermoney [playerid]");
	return 1;
}
Is that what you mean? This one is with sscanf... and dcmd (I think you can change to strcmp or zcmd if you want). And stock for GetName:

Код:
stock GetName(playerid)
{
    new name[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
		GetPlayerName(playerid, name, sizeof(name));
	}
	else
	{
	    name = "Unknown";
	}
	return name;
}
I have no idea why player money is a string.

Sorry I can't help you anyways I dont use strcmp anymore