I need help making my own stock
#1

So, i want to do like: SendMeMessage(playerid, "takes out his %s.", weaponname);

The stock obviously includes Proxdetector and player name and color and that stuff etc. Just that, SendMeMessage could be done like in the example. I've done many cool stocks for myself, but i cant imagine how i can do this one. All help is appreticated!
Reply
#2

format is easy,
pawn Код:
new string[256];
    format(string, sizeof(string), "takes out his %s", weaponname);
    SendMeMessage(playerid, -1, string);
Reply
#3

Quote:
Originally Posted by Devilxz97
Посмотреть сообщение
format is easy,
pawn Код:
new string[256];
    format(string, sizeof(string), "takes out his %s", weaponname);
    SendMeMessage(playerid, -1, string);
Not like that ... like this:

pawn Код:
stock SendMeMessage(playerid)
{
    new string[128], name[24], weapon;
   
    weapon = GetPlayerWeapon(playerid);
   
    GetPlayerName(playerid,name,24);
   
    if(weapon == 9) // chainsaw
    {
        format(string,128,"%s (%d) Takes Out His Chainsaw.",name,playerid);
    }
    return 1;
}
In a command, use SendMeMessage(playerid);

Note: This stock is just an example and is only getting weapon id 9 which is a chainsaw and will not work for anything else unless you modify it yourself. Just skim through it so you understand it better.
Reply
#4

I think you understood me wrong. It was just an example, i want to write everything with that stock, not only weapon names...

Like:
SendMeMessage(playerid, "opens the door."); ------> * Micheal opens the door.
SendMeMessage(playerid, "takes out his %s", weapon); ------> * Micheal takes out his Deagle.
SendMeMessage(playerid, "thinks of number %d", number); ------> * Micheal thinks of number 10.

I hope you get me? The format in this is what i need.
Reply
#5

hmm

pawn Код:
/*I think you understood me wrong. It was just an example, i want to write everything with that stock, not only weapon names...

Like:
SendMeMessage(playerid, "opens the door."); ------> * Micheal opens the door.
SendMeMessage(playerid, "takes out his %s", weapon); ------> * Micheal takes out his Deagle.
SendMeMessage(playerid, "thinks of number %d", number); ------> * Micheal thinks of number 10.

I hope you get me? The format in this is what i need.*/


    new pname[MAX_PLAYER_NAME], string[256];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s has open the door.", pname);
    SendClientMessage(playerid, -1, string);
  //SendMeMessage(playerid, "opens the door."); ------> * Micheal opens the door.
 
    new weapon, string[256], pname[MAX_PLAYER_NAME];
    weapon = GetPlayerWeapon(playerid);
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s takes out his weapon %s", pname, weapon);
    SendClientMessage(playerid, -1, string);
  //SendMeMessage(playerid, "takes out his %s", weapon); ------> * Micheal takes out his Deagle.
 
    new pname[MAX_PLAYER_NAME], number, string[256];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s thinks of number %d", pname, number);
    SendClientMessage(playerid, -1, string);
  //SendMeMessage(playerid, "thinks of number %d", number); ------> * Micheal thinks of number 10.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)