error 035: argument type mismatch (argument 1)
#1

Код:
SendClientMessageToAll(COL_GREEN, string);
Getiing error here
Reply
#2

Full code, please.
Reply
#3

Код:
CMD:afk(playerid, params[])
{
if(P_Data[playerid][pAdmin] == 1){
  new name[MAX_PLAYER_NAME], string[128]; //Here we area creating a new "name" and a new "string" with the size of 128. What the size basicly means is the amount of words..symbols..etc it can carry.
  GetPlayerName(playerid, name, MAX_PLAYER_NAME); //Here we are getting the name of the "playerid" which is us, and we are assigning/defining it to "name" with the size of max player name.
  format(string, sizeof(string), "%s is now afk", name); //Now here we are formating our string that we just made. What I mean by that is that we are adding our text in the string, and letting pawno add the name of our playerid which again is us..if you look at this part "%s is now afk", name %s means a string and if you test this ingame I think you will get it, after our text there is ",name" at this part we are telling pawno that the %s is the value of "name" that we just defined earlier.
  SendClientMessageToAll(COL_GREEN, string); //Now here we are sending our string to everyone in the server.
  TogglePlayerControllable(playerid, 0); //Here we are making the player not moveable what I mean by that is that he can't move at all, he can't even move the camera.
  return 1; // Here we are making the our code get returned to the player what I mean by that is that it will let the code work. If you choose return 0 it wont return anything, ingame you will get the UNKOWN SERVER COMMAND error
}}

CMD:back(playerid, params[])
{
 if(P_Data[playerid][pAdmin] == 1){
 	new name[MAX_PLAYER_NAME], string[128]; //Again here we are creating a new "name" and a new "string" with the size of 128.
 	GetPlayerName(playerid, name, MAX_PLAYER_NAME); //Here we are getting the playerid's name which means us the guy that typed in the command..So now we are getting the name of the player that typed in the command and assigning it to "name" with the size of max player name.
 	format(string, sizeof(string), "%s is now back from afk", name); //Now here we are formating our string.
 	SendClientMessageToAll(COL_GREEN, string); //Here we are sending our string to everyone in the  server.
 	TogglePlayerControllable(playerid, 1); //At this part we are making the player moveable again.
 	return 1; //Here we are making the code get returned to the player so it works.
}}
Reply
#4

HELP ME
Reply
#5

yes and there's not undefined error there's a argument error
Reply
#6

FORGET IT NOW I FIXED IT
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)