27.08.2010, 14:04
how then? what to type?
/* use `string_change[]` for things to add like (( or )), MUST use for roleplay servers!
Make string_change `local` if you want to use it for local chat
Make string_change `ooc` if you want to use it for ooc chat
Make string_change `ic` if you want to use it for ic chat*/
stock SendLocalMessage(playerid, color, string[], string_change[])
{
new Float:x, Float:y, Float:z, name[24], str_con[128];
GetPlayerName(playerid, name, sizeof name);
GetPlayerPos(playerid, x, y, z);
if(string_change == local)
{
format(str_con, 128, "%s(%d) says: %s", name, playerid, string);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, x, y, z))
{
SendClientMessage(i, color, string);
return 1;
}
}
}
else if(string_change == ooc)
{
format(str_con, 128, "(( %s: (%d) %s ))", name, playerid, string);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, x, y, z))
{
SendClientMessage(i, color, string);
return 1;
}
}
}
else if(string_change == ic)
{
format(str_con, 128, "%s: (%d) %s", name, playerid, string);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, x, y, z))
{
SendClientMessage(i, color, string);
return 1;
}
}
}
return 0;
}
Can someone make a /help command for me so i just can write in what text to come?
|
if(strcmp(cmd, "/help", true) == 0) {
SendClientMessage(playerid, YOUR_COLOR, "Type What you want the command to show here");
SendClientMessage(playerid, YOUR_COLOR, "Type What you want the command to show here");
SendClientMessage(playerid, YOUR_COLOR, "Type What you want the command to show here");
SendClientMessage(playerid, YOUR_COLOR, "Type What you want the command to show here");
return 1;
}
#define YOUR_COLOR Hexcodehere
public OnPlayerCommandText(playerid, cmdtext[]) if( !strcmp( cmdtext, "/help", true )) { SendClientMessage( playerid, 0xFFFF00FF, "Your text in yellow" ); //add more return true; }
C:\Users\Alle\Desktop\GTA SA Shit\GTA Server\gamemodes\Deathmatch.pwn(218) : warning 209: function "OnPlayerCommandText" should return a value Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
public OnPlayerCommandText(playerid, cmdtext[])
if( !strcmp( cmdtext, "/help", true ))
{
SendClientMessage( playerid, 0xFFFF00FF, "Your text in yellow" );
//add more
return true;
}
return 1; or //return 0; Don't rember which one
}
i need /cancelhit for hitman (i use GF)
EX: if(strcmp(cmd, "/cancelhit", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == { if(GoChase[playerid] < 999) { GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(hitid, giveplayer, sizeof(giveplayer)); format(string,sizeof string,"Hitman %s has canceled %s(ID:%d) contract.", sendername , giveplayer, hitid); SendFamilyMessage(8, COLOR_YELLOW, string); GetChased[playerid] = 999; GoChase[playerid] = 999; GotHit[playerid] = 0; hitid = 999; hitfound = 1; } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not a Hitman!"); } } return 1; } |