SA-MP Forums Archive
need some help - 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: need some help (/showthread.php?tid=106420)



need some help - pepper - 03.11.2009

im trying to get format(string, sizeof(string), to show twice but it only shows one or the other and not both what am i doing worng?

Код:
if (!strcmp(cmdtext, "/sexshop", true))
if(IsPlayerConnected(playerid))
if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 4)
{
  timerkiller = SetTimer("sexshop", 1000, true);
  format(string, sizeof(string), "** %s Dispatch: FIRE REPORTED AT EOC IdleWood SEX Shop!!! **", sendername);
  format(string, sizeof(string), "** %s Dispatch: Get rid of the fire ASAP!!! **", sendername);
  SendRadioMessage(1, COLOR_BLUE, string);
  SendRadioMessage(2, COLOR_BLUE, string);
  SendRadioMessage(3, COLOR_BLUE, string);
  SendRadioMessage(4, COLOR_BLUE, string);
  SendRadioMessage(15, COLOR_BLUE, string);
  return 1;
}



Re: need some help - Abernethy - 03.11.2009

You can only use 1 format per string, use string2[128]; & set your second strings format to format(string2, sizeof(string2)


Re: need some help - pepper - 03.11.2009

so something like this?

were would string2[128]; go?

Код:
if (!strcmp(cmdtext, "/sexshop", true))
if(IsPlayerConnected(playerid))
if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 4)
{
  timerkiller = SetTimer("sexshop", 1000, true);
  format(string, sizeof(string), "** %s Dispatch: FIRE REPORTED AT EOC IdleWood SEX Shop!!! **", sendername);
  format(string2, sizeof(string2), "** %s Dispatch: Get rid of the fire ASAP!!! **", sendername);
  SendRadioMessage(1, COLOR_BLUE, string);
  SendRadioMessage(2, COLOR_BLUE, string);
  SendRadioMessage(3, COLOR_BLUE, string);
  SendRadioMessage(4, COLOR_BLUE, string);
  SendRadioMessage(15, COLOR_BLUE, string);
  return 1;
}



Re: need some help - Abernethy - 03.11.2009

Quote:
Originally Posted by pepper
so something like this?

were would string2[128]; go?

Код:
if (!strcmp(cmdtext, "/sexshop", true))
if(IsPlayerConnected(playerid))
if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 4)
{
  timerkiller = SetTimer("sexshop", 1000, true);
  format(string, sizeof(string), "** %s Dispatch: FIRE REPORTED AT EOC IdleWood SEX Shop!!! **", sendername);
  format(string2, sizeof(string2), "** %s Dispatch: Get rid of the fire ASAP!!! **", sendername);
  SendRadioMessage(1, COLOR_BLUE, string);
  SendRadioMessage(2, COLOR_BLUE, string);
  SendRadioMessage(3, COLOR_BLUE, string);
  SendRadioMessage(4, COLOR_BLUE, string);
  SendRadioMessage(15, COLOR_BLUE, string);
  return 1;
}
Find where you put new string[cells]; & change it to: new string[cells], string2[61];


Re: need some help - pepper - 03.11.2009

so this is what i got and still won't work lol im to much of a noob

Код:
if (!strcmp(cmdtext, "/sexshop", true))
if(IsPlayerConnected(playerid))
if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 4)
{
  timerkiller = SetTimer("sexshop", 1000, true);
  format(string, sizeof(string), "** %s Dispatch: FIRE REPORTED AT EOC IdleWood SEX Shop!!! **", sendername);
  new string2[61];
  format(string2, sizeof(string2), "** %s Dispatch: Get rid of fire ASAP!!! **", sendername);
  SendRadioMessage(1, COLOR_BLUE, string);
  SendRadioMessage(2, COLOR_BLUE, string);
  SendRadioMessage(3, COLOR_BLUE, string);
  SendRadioMessage(4, COLOR_BLUE, string);
  SendRadioMessage(15, COLOR_BLUE, string);
  return 1;
}



Re: need some help - pepper - 03.11.2009

any ideas?


Re: need some help - dice7 - 04.11.2009

You're only sending 'string'. What about 'string2' ?


Re: need some help - pepper - 04.11.2009

ant this the sending part of string 2?

Код:
format(string2, sizeof(string2), "** %s Dispatch: Get rid of the fire ASAP!!! **", sendername);
sorry for being so noobise 1st time messing with the strings


Re: need some help - dice7 - 04.11.2009

No, that's only creating it.
Use SendRadioMessage(id, color, string); to send it


Re: need some help - pepper - 04.11.2009

ok that worked thanx a ton for the help one more qustion with out makeing a new topic how would i add a timer so it does the command like every 5mins without have to do the command every time if thats even possible?