commands problem help +1 rep - 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: commands problem help +1 rep (
/showthread.php?tid=337176)
commands problem help +1 rep -
sscarface - 25.04.2012
i have two /stats commands and one is Dialog and 2nd one is text draw and i have dialog /stats but i want text draw can u help me
Код:
if(strcmp(cmd, "/stats", true) == 0)
{
new string[345];new cName[MAX_PLAYER_NAME];GetPlayerName(playerid,cName,sizeof(cName));
new Str[10];
if(PlayerDonated[playerid]==true) format(Str,sizeof(Str),"Yes");
else if(PlayerDonated[playerid]==false) format(Str,sizeof(Str),"No");
format(string, sizeof string, "Account STATUS!\n\n\
Username: %s\n\
Money: $%d \n\
Score: %d \n\
WantedLevel: %d \n\
Donated: %s",
cName,GetPlayerMoney(playerid),GetPlayerScore(playerid),GetPlayerWantedLevel(playerid),Str);
ShowPlayerDialog(playerid, 6846, DIALOG_STYLE_MSGBOX, "Stats!", string, "Close", "");
return 1;
}
and this is text draw
Код:
COMMAND:stats(playerid,params[])
{
new string[364];
new ID;
if(IsSpawned[playerid] != 1)
{
SendClientMessage(playerid,COLOR_RED,"You must be alive and spawned in order to be able to use this command.");
return 1;
}
if(sscanf(params, "u", ID))
{
ID=playerid;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server.",ID);
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
format(string, sizeof(string), "~b~%s's Stats ~y~ID:(%d)~n~~n~~n~~b~Kills: ~w~%d~n~~b~Deaths: ~w~%d~n~~b~Score: ~w~%d~n~~b~Wanted Level: ~w~%d~n~~b~Money Bags: ~w~%d~n~~b~Won Lotto: ~w~%d~n~~n~~b~Time On Server: ~g~%d:%d:%d~n~~b~Donator: ~g~Yes~n~~y~/Morestats",PlayerName(ID),ID,PI[ID][pKills], PI[ID][pDeaths],GetPlayerScore(ID),GetPlayerWantedLevel(ID),PI[ID][pRegular],PI[ID][pMoneyBags],PI[ID][pLotto],PI[ID][pHour],PI[ID][pMin],PI[ID][pSec]);
TextDrawSetString(Stats[playerid], string);
TextDrawShowForPlayer(playerid, Stats[playerid]);
}
return 1;
}
and i add text draw command in my gm but error dont sent or send error report and then i click dont sent so my pawn is close but /stats not working can u give fix this textdraw /stats commands
Re: commands problem help +1 rep -
MP2 - 25.04.2012
You never actually create the textdraw.
Re: commands problem help +1 rep -
sscarface - 25.04.2012
i need more comment
Re: commands problem help +1 rep -
[swat]dragon - 25.04.2012
i didnt understand your request, can you explain better what you need?
so we may help you better
Re: commands problem help +1 rep -
sscarface - 25.04.2012
i want 2nd /stats cmd add to my 1st one /stats cmd