Heeelp with this commands -
Man43 - 17.04.2017
Hello im making players colors but not worked.. how to i can fix it?
Код:
stock SetPlayerWantedLevel(playerid, level)
{
switch(level)
{
case 0: SetPlayerColor(playerid, COLOR_WHITE);
case 1: SetPlayerColor(playerid, COLOR_YELLOW);
case 2: SetPlayerColor(playerid, COLOR_YELLOW);
case 3: SetPlayerColor(playerid, COLOR_ORANGE);
case 4: SetPlayerColor(playerid, COLOR_DARKORANGE);
case 5: SetPlayerColor(playerid, COLOR_RED);
case 6: SetPlayerColor(playerid, COLOR_RED);
}
return SetPlayerWantedLevel(playerid, level);
}
Here >> For /do + /pm i want fix it.
Here no bugs but When i type /do i got >> My Message ((And Here my name)) so i want fix it.... i want My Name (( Here Message ))
Код:
CMD:do(playerid, params[])
{
new text[128], str[128];
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /do [text]");
format(str, sizeof(str), "* %s (( %s )) *", text, GetName(playerid));
SendClientMessageToAll(COLOR_ORANGE, str);
return 1;
}
Here /pm i trying to fix it but still not work... im typing /pm 0 TesT i got random number [ID] Please help
Код:
CMD:pm(playerid, parmas[])
{
new ID,
Message[256],
String[256],
String2[256];
if(sscanf(parmas, "us[256]", ID, Message)) return SendClientMessage(playerid, COLOR_RED, "Usage: /pm [id] [message]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Player not connected!");
if(ID == playerid) return SendClientMessage(playerid, COLOR_RED, "You can not PM yourself!");
if(PlayerInfo[ID][Block] == playerid) return SendClientMessage(playerid, COLOR_RED, "The player has chosen not recieve Pms from you!");
format(String, sizeof(String), "%s [%d] is no more accepting private messages!");
if(PlayerInfo[ID][PmOff] == 1) return SendClientMessage(playerid, COLOR_YELLOW, String);
if(PlayerInfo[playerid][PmOff] == 1) return SendClientMessage(playerid, COLOR_RED,"You can not send private message when you have switched off your pms!");
format(String2, sizeof(String2), "[PM]: To %s(%d): %s", PlayerName(ID), Message);
SendClientMessage(playerid, COLOR_YELLOW, String2);
format(String2, sizeof(String2), "[PM]: From %s[%d]: %s", PlayerName(playerid), Message);
SendClientMessage(ID, COLOR_YELLOW, String2);
PlayerInfo[ID][Lastpm] = playerid;
return 1;
}
Re: Heeelp with this commands -
Vince - 17.04.2017
You can't have a function with the same name as a native function. If you want to hook it then look up the ALS hooking method.
Re: Heeelp with this commands -
Man43 - 17.04.2017
Please i need help there...
Re: Heeelp with this commands -
DarkSkull - 17.04.2017
There is already a function called SetPlayerWantedLevel(); You can't use that again. You should change the name of the function.
PHP код:
stock SetPlayerWanted(playerid, level)
{
switch(level)
{
case 0: SetPlayerColor(playerid, COLOR_WHITE);
case 1: SetPlayerColor(playerid, COLOR_YELLOW);
case 2: SetPlayerColor(playerid, COLOR_YELLOW);
case 3: SetPlayerColor(playerid, COLOR_ORANGE);
case 4: SetPlayerColor(playerid, COLOR_DARKORANGE);
case 5: SetPlayerColor(playerid, COLOR_RED);
case 6: SetPlayerColor(playerid, COLOR_RED);
}
return SetPlayerWantedLevel(playerid, level);
}
I've changed it to SetPlayerWanted(); Use this instead.
For /do command, You have the message and name mixed up! This should fix it.
PHP код:
CMD:do(playerid, params[])
{
new text[128], str[128];
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /do [text]");
format(str, sizeof(str), "* %s (( %s )) *", GetName(playerid), text);
SendClientMessageToAll(COLOR_ORANGE, str);
return 1;
}
Re: Heeelp with this commands -
DarkSkull - 17.04.2017
This line in /pm should be
PHP код:
format(String, sizeof(String), "%s [%d] is no more accepting private messages!", GetName(ID), ID);
And you missed the ID specifier in both your PM messages.
PHP код:
format(String2, sizeof(String2), "[PM]: To %s(%d): %s", PlayerName(ID), ID,Message);
SendClientMessage(playerid, COLOR_YELLOW, String2);
format(String2, sizeof(String2), "[PM]: From %s[%d]: %s", PlayerName(playerid), playerid,Message);
SendClientMessage(ID, COLOR_YELLOW, String2);