How to add the name to /duty and this object id. - 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)
+--- Thread: How to add the name to /duty and this object id. (
/showthread.php?tid=349068)
How to add the name to /duty and this object id. -
Gangster-rocks - 07.06.2012
pawn Код:
if (strcmp("/duty3s", cmdtext, true, 10) == 0)
{ SetPlayerSkin(playerid,287);
GivePlayerWeapon(playerid,24,100);
GivePlayerWeapon(playerid,31,1000);
SetPlayerColor(playerid,0xFF0808);
new string[35];
format(string,sizeof(string),"General %i is Now onduty.","Name");
SendClientMessage(playerid,0xFFFFFAA,string);
// player dead
return 1;
}
When i do that its only shows numbers and whaen i use %c its show a ex:General N Is Now onduty
Now the Object id:
Re: How to add the name to /duty and this object id. -
zDevon - 07.06.2012
%i is for integers, aka numbers. %s is used to store strings. Your "Name" is also undefined.
pawn Код:
if (strcmp("/duty3s", cmdtext, true, 10) == 0)
{
SetPlayerSkin(playerid,287);
GivePlayerWeapon(playerid,24,100);
GivePlayerWeapon(playerid,31,1000);
SetPlayerColor(playerid,0xFF0808);
new string[35];
new name[24];
format(string,sizeof(string),"General %s is Now onduty.",GetPlayerName(playerid,name,24));
SendClientMessage(playerid,0xFFFFFAA,string);
// player dead
return 1;
}
Re: How to add the name to /duty and this object id. -
DartakousLien - 07.06.2012
I'm not sure, but I think you can not use it here
pawn Код:
new name[24];
format(string,sizeof(string),"General %s is Now onduty.",GetPlayerName(playerid,name,24));
use so
pawn Код:
name[24];
GetPlayerName(playerid,name,24);
format(string,sizeof(string),"General %s is Now onduty.",name);
and the string is short
Re: How to add the name to /duty and this object id. -
zDevon - 07.06.2012
That would produce the same result.
Re: How to add the name to /duty and this object id. -
DartakousLien - 07.06.2012
i don't know...