08.07.2011, 11:32
hi,
i made some teleport commands and whit every teleport all the other players get a message. Now i like to turn on and off the message for every player. I tried it but i failed:
And here are the teleport:
I hope you know what i mean and you can help me
i made some teleport commands and whit every teleport all the other players get a message. Now i like to turn on and off the message for every player. I tried it but i failed:
Код:
if(strcmp("/messageoff",cmdtext,true) == 0)
{
if(GetPVarInt(playerid,"SendJumpMessage") == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"Jumpmessages are now OFF!");
SetPVarInt(playerid,"SendJumpMessage",1);
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"Jumpmessages are already off!");
}
return 1;
}
if(strcmp("/messageon",cmdtext,true) == 0)
{
if(GetPVarInt(playerid,"SendJumpMessage") == 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"Jumpmessages are now ON!");
SetPVarInt(playerid,"SendJumpMessage",0);
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"Jumpmessages are already on!");
}
return 1;
}
Код:
if(!strcmp(strget(cmdtext,0),"/cave"))
{
if(GetPVarInt(playerid,"jump") == 0)
{
if(!strlen(strget(cmdtext,1)))
return
SendClientMessage(playerid,COLOR_GREY,"Use: /cave 1 - 25");
new cave = strval(strget(cmdtext,1));
new name[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid,name,sizeof(name));
SetPVarInt(playerid, "jump", 1);
SetTimerEx("JumpTimer",7800,false,"i",playerid);
SetTimerEx("caveloading",1500,false,"i",playerid);
GivePlayerWeapon(playerid,46,1);
for(new i; i < MAX_PLAYERS; i++)
TogglePlayerControllable(playerid,0);
{
if(cave==1)
{
SetPlayerPos(playerid,2000.8845,-161.3129,240.9698);
format(string,sizeof(string),"* [ID: %d] %s has teleported to /cave 1",playerid,name);
if(GetPVarInt(i,"SendJumpMessage") == 0)
{
SendClientMessageToALL(COLOR_WHITE,string);
}}
if(cave==2)
{
SetPlayerPos(playerid,-3179.7832,-998.5700,770.7665);
format(string,sizeof(string),"* [ID: %d] %s has teleported to /cave 2",playerid,name);
if(GetPVarInt(i,"SendJumpMessage") == 0)
{
SendClientMessageToALL(COLOR_WHITE,string);
}}

