How do I?...
#1

Ok im not sure how to but I want to make chat rooms like /a[dmin] , /G[lobal] , ect. can someone give me an example?
also how do I make it show what skin im chosing before I spawn . aka a skin selection that actually shows what skin Im on when I try to make it I get a black screen...
Reply
#2

search for Seifader.
Reply
#3

Quote:
Originally Posted by laser50
search for Seifader.
That's not right at all. Maybe if you actually read the post thoroughly. Anyway, if you want to see the skin you're choosing, just place the player where you want him to be under OnPlayerRequestClass. Here's an example.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid,297.5041,-81.8028,1002.5341);
    SetPlayerFacingAngle(playerid,346.8848);
    SetPlayerCameraPos(playerid,297.504089,-80.802795,1002.534057);
    SetPlayerCameraLookAt(playerid,296.504089,-94.802795,1006.534057);
    ApplyAnimation(playerid,"DEALER","DEALER_IDLE",4.1,0,1,1,1,1);
    SetPlayerInterior(playerid,4);
    return 1;
}
You can just change the position, camera angle, animation, etc.
Reply
#4

Quote:
Originally Posted by laser50
search for Seifader.
I kinda wanted something else lol
but this did give me an idea for my GM ^^

@Backwardsman97
Thanks this will help alot !

also can someone help me with this :
Код:
if(strcmp(cmdtext, "/g", true)==0 || strcmp(cmdtext, "/global", true)==0)
{
  new tmp[128], message, str[128], pName[MAX_PLAYER_NAME];
  tmp = strtok(cmdtext, idx);
  message = strval(tmp);
  GetPlayerName(playerid, pName, sizeof(pName));
  format(str, sizeof(str), "%s (%s): %s", pName, playerid, message);
  SendClientMessageToAll(color, str);//Change color
  return 1;
}
\
when i press /g{enter}
I get exampleName()
but when I try something like : /g Hello
i get a SERVER:UNKNOWNCOMMAND Warning can someone help?
Reply
#5

This turns the value into a number: message = strval(tmp);

So try: format(message,sizeof(message),"%s",tmp);

Also make sure message is declared as a string, example:
new tmp[128], message[128], str[128], pName[MAX_PLAYER_NAME];
Reply
#6

Код:
C:\Users\Chris\Desktop\Sa-Mp Server\gamemodes\Gm.pwn(84) : error 033: array must be indexed (variable "message")
Reply
#7

Interesting... What is line 84?

If this is Line 84: message = strval(tmp);
Then it needs to be removed :P
Reply
#8

Yeah that was it xD ok it compiled well once im done with this Gm im messin with ill test it
Reply
#9

When I try the command nothing happens I dont even get a Sever Unknown command message..
Reply
#10

Well actually there is no need for the message var at all, so let's remove that entirely & see if this works:

pawn Код:
if(strcmp(cmdtext, "/g", true)==0 || strcmp(cmdtext, "/global", true)==0)
{
  new tmp[128], str[128], pName[MAX_PLAYER_NAME];
  tmp = strtok(cmdtext, idx);
  GetPlayerName(playerid, pName, sizeof(pName));
  format(str, sizeof(str), "%s (%s): %s", pName, playerid, tmp);
  SendClientMessageToAll(color, str);//Change color
  printf("tmp: %s"); // Just used while testing, this could make it easier to spot any error, remove when everything works
  return 1;
}
If /g is what the print says tmp is, then add another strtok in there, then test again...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)