need some help
#1

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;
}
Reply
#2

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

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;
}
Reply
#4

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];
Reply
#5

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;
}
Reply
#6

any ideas?
Reply
#7

You're only sending 'string'. What about 'string2' ?
Reply
#8

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
Reply
#9

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)