Convert to Zcmd.
#1

Hi, I need your help, I have command /shake and /shake accept (1-7) need to redo commands ZCMD, and I'm confused, not helped by someone to do it? Thank you in advance.



Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new tmp[256];
	new cmd[256];
	new idx;
	cmd = strtok(cmdtext, idx);
	new giveplayer[MAX_PLAYER_NAME];
	new sendername[MAX_PLAYER_NAME];
	new number[256];

    if(strcmp(cmd,"/shake",true)==0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /shake [playerid/PartOfName]");
				return 1;
			}
			new giveplayerid;
			giveplayerid = strval(tmp);
			if (IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			       if (ProxDetectorS(8.0, playerid, giveplayerid))
					   {
					       if(giveplayerid == playerid)
					       {
					            SendClientMessage(playerid, COLOR_GREY, "   You can't handshake yourself");
					            return 1;
					       }
					       new string[256];
					       GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						   GetPlayerName(playerid, sendername, sizeof(sendername));
					       format(string, sizeof(string), "* You offered %s a handshake .", giveplayer);
						   SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						   format(string, sizeof(string), "* %s is offering you a handshake, (type /accept shake[1-7]).", sendername);
						   SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
						   ShakeOffer[giveplayerid] = playerid;
					    }
					    else
					    {
					            SendClientMessage(playerid, COLOR_GREY, "   That player is not near you!");
					    }
				 }
    		}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Invalid ID/Name!");
			    return 1;
			}
	    }
		return 1;
	}
	
 	if(strcmp(cmd,"/accept",true)==0)
	{
	
	number = strtok(cmdtext, idx);

	if(!strlen(number)) {
	SendClientMessage(playerid, COLOR_WHITE, "USAGE: /accept [name]");
	SendClientMessage(playerid, COLOR_GREY, "Available names: Shake(1-7)");
	return 1;
	}
	if(strcmp(number,"shake",true) == 0)
	{
 	if(ShakeOffer[playerid] < TOUR_SHAKE)
	{
 		if(IsPlayerConnected(ShakeOffer[playerid]))
   		{
   		new string[256];
		GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
     	GetPlayerName(playerid, sendername, sizeof(sendername));
       format(string, sizeof(string), "* You have accepted the handshake.");
       SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
       format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
       ApplyAnimation(playerid,"GANGS","hndshkfa_swt",4.0,0,0,0,0,0);
       ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkfa_swt",4.0,0,0,0,0,0);
       SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
       ShakeOffer[playerid] = TOUR_SHAKE;
       	return 1;
        }
        	else
	        {
         SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
         return 1;
         }
         }
        	}
        			else if(strcmp(number,"shake1",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkaa",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkaa",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake2",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkba",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkba",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake3",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
  			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkca",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkca",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake4",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
  			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkcb",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkcb",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake5",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
  			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkda",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkda",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake6",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
  			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkea",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkea",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake7",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
  			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkfa",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkfa",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
                    }
          	}
	return 0;
}
Pastebin verison: http://pastebin.com/Y5tnZNDE
Reply
#2

Please, somebody would help me and glanced at the code?
Reply
#3

Quote:
Originally Posted by FinStar
Посмотреть сообщение
Hi, I need your help, I have command /shake and /shake accept (1-7) need to redo commands ZCMD, and I'm confused, not helped by someone to do it? Thank you in advance.



Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new tmp[256];
	new cmd[256];
	new idx;
	cmd = strtok(cmdtext, idx);
	new giveplayer[MAX_PLAYER_NAME];
	new sendername[MAX_PLAYER_NAME];
	new number[256];

    if(strcmp(cmd,"/shake",true)==0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /shake [playerid/PartOfName]");
				return 1;
			}
			new giveplayerid;
			giveplayerid = strval(tmp);
			if (IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			       if (ProxDetectorS(8.0, playerid, giveplayerid))
					   {
					       if(giveplayerid == playerid)
					       {
					            SendClientMessage(playerid, COLOR_GREY, "   You can't handshake yourself");
					            return 1;
					       }
					       new string[256];
					       GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						   GetPlayerName(playerid, sendername, sizeof(sendername));
					       format(string, sizeof(string), "* You offered %s a handshake .", giveplayer);
						   SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
						   format(string, sizeof(string), "* %s is offering you a handshake, (type /accept shake[1-7]).", sendername);
						   SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
						   ShakeOffer[giveplayerid] = playerid;
					    }
					    else
					    {
					            SendClientMessage(playerid, COLOR_GREY, "   That player is not near you!");
					    }
				 }
    		}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   Invalid ID/Name!");
			    return 1;
			}
	    }
		return 1;
	}
	
 	if(strcmp(cmd,"/accept",true)==0)
	{
	
	number = strtok(cmdtext, idx);

	if(!strlen(number)) {
	SendClientMessage(playerid, COLOR_WHITE, "USAGE: /accept [name]");
	SendClientMessage(playerid, COLOR_GREY, "Available names: Shake(1-7)");
	return 1;
	}
	if(strcmp(number,"shake",true) == 0)
	{
 	if(ShakeOffer[playerid] < TOUR_SHAKE)
	{
 		if(IsPlayerConnected(ShakeOffer[playerid]))
   		{
   		new string[256];
		GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
     	GetPlayerName(playerid, sendername, sizeof(sendername));
       format(string, sizeof(string), "* You have accepted the handshake.");
       SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
       format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
       ApplyAnimation(playerid,"GANGS","hndshkfa_swt",4.0,0,0,0,0,0);
       ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkfa_swt",4.0,0,0,0,0,0);
       SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
       ShakeOffer[playerid] = TOUR_SHAKE;
       	return 1;
        }
        	else
	        {
         SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
         return 1;
         }
         }
        	}
        			else if(strcmp(number,"shake1",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkaa",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkaa",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake2",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkba",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkba",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake3",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
  			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkca",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkca",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake4",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
  			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkcb",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkcb",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake5",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
  			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkda",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkda",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake6",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
  			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkea",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkea",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
          	}
			else if(strcmp(number,"shake7",true) == 0)
			{
			    if(ShakeOffer[playerid] < TOUR_SHAKE)
			    {
			        if(IsPlayerConnected(ShakeOffer[playerid]))
			        {
  			            new string[256];
                        GetPlayerName(ShakeOffer[playerid], giveplayer, sizeof(giveplayer));
			            GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* You have accepted the handshake.");
		            	SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			            format(string, sizeof(string), "* %s has accepted your handshake offer.",sendername);
			            ApplyAnimation(playerid,"GANGS","hndshkfa",4.0,0,0,0,0,0);
			            ApplyAnimation(ShakeOffer[playerid],"GANGS","hndshkfa",4.0,0,0,0,0,0);
			            SendClientMessage(ShakeOffer[playerid], COLOR_LIGHTBLUE, string);
                        ShakeOffer[playerid] = TOUR_SHAKE;
                        return 1;
                    }
			        else
			        {
                        SendClientMessage(playerid, COLOR_GREY, "   No-one has offered a handshake...");
                        return 1;
                        }
                    }
                    }
          	}
	return 0;
}
Pastebin verison: http://pastebin.com/Y5tnZNDE
Here you go

PHP код:
COMMAND:shake(playeridparams[])
{
    new 
targetid,string[128],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
    if(
sscanf(params"ui"targetid)) SendClientMessage(playeridCOLOR_GREY"USAGE: /shake [playerid]");
    else
    {
        if (
playerid == targetid) return SendClientMessage(playeridCOLOR_GREY"You cannot pay to yourself.");
        if(
IsPlayerConnected(targetid))
        {
            if(
PlayerToPlayer(playerid,targetid,8.0))
               {
                   
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(targetid));
                  
GiveNameSpace(sendername);
                
GiveNameSpace(giveplayer);
                
format(stringsizeof(string), "You offered %s a handshake."giveplayer);
                   
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
                
format(stringsizeof(string), "%s gave you a handshake (/accept shake1-8)."sendername);
                
SendClientMessage(targetid,COLOR_LIGHTBLUE,string);
               }
               else
               {
                   
SendClientMessage(playerid,COLOR_GREY,"You are not close enough to that player !");
               }
        }
    }
    return 
1;
}
COMMAND:accept(playeridparams[])
{
    new 
type[128],string[128],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME], Float:xFloat:yFloat:z;
    if(
sscanf(params"s[128]"type)) SendClientMessage(playeridCOLOR_GREY"USAGE: /accept {FFFFFF}[shake1-6]");
    else
    {
        if (
GetPVarInt(playerid"PlayerLogged") == 0) return SendClientMessage(playeridCOLOR_WHITE"You must be logged in to use this.");
        if(
GetPVarInt(playerid"Mute") == 1) return SendClientMessage(playeridCOLOR_LIGHTRED"You are currently muted !");
           if(
strcmp(type"death"true) == 0)
           {
               
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
               
format(stringsizeof(string), "%s has accepted death.",sendername);
               
ProxDetector(20.0playeridstringCOLOR_WHITE);
           }
           else if(
strcmp(type"trunk"true) == 0)
           {
               if(
GetPVarInt(playerid"TrunkOffer") != 501)
               {
                   if(
IsPlayerConnected(GetPVarInt(playerid"TrunkOffer")))
                {
                    if(
PlayerToPlayer(playerid,GetPVarInt(playerid"TrunkOffer"),5.0))
                    {
                        
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                        
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(GetPVarInt(playerid"TrunkOffer")));
                          
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        
format(stringsizeof(string), "You accepted %s's offer."giveplayer);
                           
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "%s has accepted your offer."sendername);
                        
SendClientMessage(GetPVarInt(playerid"TrunkOffer"), COLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "*** %s places %s inside the trunk."giveplayersendername);
                        
ProxDetector(30.0GetPVarInt(playerid"TrunkOffer"), stringCOLOR_PURPLE);
                        
SendClientMessage(playerid,COLOR_WHITE,"You are inside the trunk, type (/exittrunk) if the trunk is open.");
                        
SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: If your stuck spectating reconnect from the server.");
                        
TogglePlayerSpectatingEx(playerid1);
                        
PlayerSpectateVehicle(playeridGetPVarInt(playerid"TrunkOfferID"));
                        
SetPVarInt(playerid,"InTrunk"GetPVarInt(playerid"TrunkOfferID"));
                        
SetPVarInt(playerid"TrunkOffer"501);
                        
DeletePVar(playerid,"TrunkOfferID");
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"You must be around the person who offered the trunk put-in."), SetPVarInt(playerid"TrunkOffer"501);
                }
                else 
SendClientMessage(playeridCOLOR_GREY"The person who offered a trunk put-in is offline."), SetPVarInt(playerid"TrunkOffer"501);
               }
               else 
SendClientMessage(playeridCOLOR_GREY"You havent been offered for a trunk put-in.");
           }
           else if(
strcmp(type"drag"true) == 0)
           {
               if(
GetPVarInt(playerid"DragOffer") != 501)
               {
                   if(
IsPlayerConnected(GetPVarInt(playerid"DragOffer")))
                {
                    if(
PlayerToPlayer(playerid,GetPVarInt(playerid"DragOffer"),5.0) && GetPVarInt(playerid"Dead") != 0)
                    {
                        
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                        
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(GetPVarInt(playerid"DragOffer")));
                          
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        
format(stringsizeof(string), "You accepted %s's drag offer."giveplayer);
                           
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "%s has accepted your drag offer."sendername);
                        
SendClientMessage(GetPVarInt(playerid"DragOffer"), COLOR_LIGHTBLUEstring);
                        
format(stringsizeof(string), "*** %s starts to drag %s."giveplayersendername);
                        
ProxDetector(30.0GetPVarInt(playerid"DragOffer"), stringCOLOR_PURPLE);
                        
TogglePlayerControllableEx(playerid,false);
                        
SetPVarInt(playerid"Drag"GetPVarInt(playerid"DragOffer"));
                        
SetPVarInt(playerid"DragOffer"501);
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"You must be around the person who offered the drag."), SetPVarInt(playerid"DragOffer"501);
                }
                else 
SendClientMessage(playeridCOLOR_GREY"The person who offered a drag is offline."), SetPVarInt(playerid"DragOffer"501);
               }
               else 
SendClientMessage(playeridCOLOR_GREY"You havent been offered for a drag.");
           }
           else if(
strcmp(type"shake1"true) == 0)
           {
               if(
GetPVarInt(playerid"ShakeOffer") != 501)
               {
                   if(
IsPlayerConnected(GetPVarInt(playerid"ShakeOffer")))
                {
                    if(
PlayerToPlayer(playerid,GetPVarInt(playerid"ShakeOffer"),8.0))
                    {
                        
SetPlayerToFacePlayer(playeridGetPVarInt(playerid"ShakeOffer"));
                        
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                        
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(GetPVarInt(playerid"ShakeOffer")));
                          
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        
format(stringsizeof(string), "You accepted %s's handshake."giveplayer);
                           
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "%s has accepted your handshake."sendername);
                        
SendClientMessage(GetPVarInt(playerid"ShakeOffer"), COLOR_LIGHTBLUEstring);
                        
ApplyAnimation(playerid,"GANGS","hndshkaa",4.0,0,0,0,0,0);
                        
ApplyAnimation(GetPVarInt(playerid"ShakeOffer"),"GANGS","hndshkaa",4.0,0,0,0,0,0);
                        
SetPVarInt(playerid"ShakeOffer"501);
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"You must be around the person who offered the shake.");
                }
                else 
SendClientMessage(playeridCOLOR_GREY"The person who offered a shake is offline."), SetPVarInt(playerid"ShakeOffer"501);
               }
               else 
SendClientMessage(playeridCOLOR_GREY"You havent been offered for a shake.");
           }
           else if(
strcmp(type"shake2"true) == 0)
           {
               if(
GetPVarInt(playerid"ShakeOffer") != 501)
               {
                   if(
IsPlayerConnected(GetPVarInt(playerid"ShakeOffer")))
                {
                    if(
PlayerToPlayer(playerid,GetPVarInt(playerid"ShakeOffer"),8.0))
                    {
                        
SetPlayerToFacePlayer(playeridGetPVarInt(playerid"ShakeOffer"));
                        
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                        
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(GetPVarInt(playerid"ShakeOffer")));
                          
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        
format(stringsizeof(string), "You accepted %s's handshake."giveplayer);
                           
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "%s has accepted your handshake."sendername);
                        
SendClientMessage(GetPVarInt(playerid"ShakeOffer"), COLOR_LIGHTBLUEstring);
                        
ApplyAnimation(playerid,"GANGS","hndshkba",4.0,0,0,0,0,0);
                        
ApplyAnimation(GetPVarInt(playerid"ShakeOffer"),"GANGS","hndshkba",4.0,0,0,0,0,0);
                        
SetPVarInt(playerid"ShakeOffer"501);
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"You must be around the person who offered the shake.");
                }
                else 
SendClientMessage(playeridCOLOR_GREY"The person who offered a shake is offline."), SetPVarInt(playerid"ShakeOffer"501);
               }
               else 
SendClientMessage(playeridCOLOR_GREY"You havent been offered for a shake.");
           }
           else if(
strcmp(type"shake3"true) == 0)
           {
               if(
GetPVarInt(playerid"ShakeOffer") != 501)
               {
                   if(
IsPlayerConnected(GetPVarInt(playerid"ShakeOffer")))
                {
                    if(
PlayerToPlayer(playerid,GetPVarInt(playerid"ShakeOffer"),8.0))
                    {
                        
SetPlayerToFacePlayer(playeridGetPVarInt(playerid"ShakeOffer"));
                        
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                        
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(GetPVarInt(playerid"ShakeOffer")));
                          
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        
format(stringsizeof(string), "You accepted %s's handshake."giveplayer);
                           
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "%s has accepted your handshake."sendername);
                        
SendClientMessage(GetPVarInt(playerid"ShakeOffer"), COLOR_LIGHTBLUEstring);
                        
ApplyAnimation(playerid,"GANGS","hndshkca",4.0,0,0,0,0,0);
                        
ApplyAnimation(GetPVarInt(playerid"ShakeOffer"),"GANGS","hndshkca",4.0,0,0,0,0,0);
                        
SetPVarInt(playerid"ShakeOffer"501);
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"You must be around the person who offered the shake.");
                }
                else 
SendClientMessage(playeridCOLOR_GREY"The person who offered a shake is offline."), SetPVarInt(playerid"ShakeOffer"501);
               }
               else 
SendClientMessage(playeridCOLOR_GREY"You havent been offered for a shake.");
           }
           else if(
strcmp(type"shake4"true) == 0)
           {
               if(
GetPVarInt(playerid"ShakeOffer") != 501)
               {
                   if(
IsPlayerConnected(GetPVarInt(playerid"ShakeOffer")))
                {
                    if(
PlayerToPlayer(playerid,GetPVarInt(playerid"ShakeOffer"),8.0))
                    {
                        
SetPlayerToFacePlayer(playeridGetPVarInt(playerid"ShakeOffer"));
                        
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                        
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(GetPVarInt(playerid"ShakeOffer")));
                          
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        
format(stringsizeof(string), "You accepted %s's handshake."giveplayer);
                           
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "%s has accepted your handshake."sendername);
                        
SendClientMessage(GetPVarInt(playerid"ShakeOffer"), COLOR_LIGHTBLUEstring);
                        
ApplyAnimation(playerid,"GANGS","hndshkcb",4.0,0,0,0,0,0);
                        
ApplyAnimation(GetPVarInt(playerid"ShakeOffer"),"GANGS","hndshkcb",4.0,0,0,0,0,0);
                        
SetPVarInt(playerid"ShakeOffer"501);
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"You must be around the person who offered the shake.");
                }
                else 
SendClientMessage(playeridCOLOR_GREY"The person who offered a shake is offline."), SetPVarInt(playerid"ShakeOffer"501);
               }
               else 
SendClientMessage(playeridCOLOR_GREY"You havent been offered for a shake.");
           }
           else if(
strcmp(type"shake5"true) == 0)
           {
               if(
GetPVarInt(playerid"ShakeOffer") != 501)
               {
                   if(
IsPlayerConnected(GetPVarInt(playerid"ShakeOffer")))
                {
                    if(
PlayerToPlayer(playerid,GetPVarInt(playerid"ShakeOffer"),8.0))
                    {
                        
SetPlayerToFacePlayer(playeridGetPVarInt(playerid"ShakeOffer"));
                        
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                        
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(GetPVarInt(playerid"ShakeOffer")));
                          
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        
format(stringsizeof(string), "You accepted %s's handshake."giveplayer);
                           
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "%s has accepted your handshake."sendername);
                        
SendClientMessage(GetPVarInt(playerid"ShakeOffer"), COLOR_LIGHTBLUEstring);
                        
ApplyAnimation(playerid,"GANGS","hndshkda",4.0,0,0,0,0,0);
                        
ApplyAnimation(GetPVarInt(playerid"ShakeOffer"),"GANGS","hndshkda",4.0,0,0,0,0,0);
                        
SetPVarInt(playerid"ShakeOffer"501);
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"You must be around the person who offered the shake.");
                }
                else 
SendClientMessage(playeridCOLOR_GREY"The person who offered a shake is offline."), SetPVarInt(playerid"ShakeOffer"501);
               }
               else 
SendClientMessage(playeridCOLOR_GREY"You havent been offered for a shake.");
           }
           else if(
strcmp(type"shake6"true) == 0)
           {
               if(
GetPVarInt(playerid"ShakeOffer") != 501)
               {
                   if(
IsPlayerConnected(GetPVarInt(playerid"ShakeOffer")))
                {
                    if(
PlayerToPlayer(playerid,GetPVarInt(playerid"ShakeOffer"),8.0))
                    {
                        
SetPlayerToFacePlayer(playeridGetPVarInt(playerid"ShakeOffer"));
                        
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                        
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(GetPVarInt(playerid"ShakeOffer")));
                          
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        
format(stringsizeof(string), "You accepted %s's handshake."giveplayer);
                           
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "%s has accepted your handshake."sendername);
                        
SendClientMessage(GetPVarInt(playerid"ShakeOffer"), COLOR_LIGHTBLUEstring);
                        
ApplyAnimation(playerid,"GANGS","hndshkea",4.0,0,0,0,0,0);
                        
ApplyAnimation(GetPVarInt(playerid"ShakeOffer"),"GANGS","hndshkea",4.0,0,0,0,0,0);
                        
SetPVarInt(playerid"ShakeOffer"501);
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"You must be around the person who offered the shake.");
                }
                else 
SendClientMessage(playeridCOLOR_GREY"The person who offered a shake is offline."), SetPVarInt(playerid"ShakeOffer"501);
               }
               else 
SendClientMessage(playeridCOLOR_GREY"You havent been offered for a shake.");
           }
           else if(
strcmp(type"shake7"true) == 0)
           {
               if(
GetPVarInt(playerid"ShakeOffer") != 501)
               {
                   if(
IsPlayerConnected(GetPVarInt(playerid"ShakeOffer")))
                {
                    if(
PlayerToPlayer(playerid,GetPVarInt(playerid"ShakeOffer"),8.0))
                    {
                        
SetPlayerToFacePlayer(playeridGetPVarInt(playerid"ShakeOffer"));
                        
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                        
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(GetPVarInt(playerid"ShakeOffer")));
                          
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        
format(stringsizeof(string), "You accepted %s's handshake."giveplayer);
                           
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "%s has accepted your handshake."sendername);
                        
SendClientMessage(GetPVarInt(playerid"ShakeOffer"), COLOR_LIGHTBLUEstring);
                        
ApplyAnimation(playerid,"GANGS","hndshkfa",4.0,0,0,0,0,0);
                        
ApplyAnimation(GetPVarInt(playerid"ShakeOffer"),"GANGS","hndshkfa",4.0,0,0,0,0,0);
                        
SetPVarInt(playerid"ShakeOffer"501);
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"You must be around the person who offered the shake.");
                }
                else 
SendClientMessage(playeridCOLOR_GREY"The person who offered a shake is offline."), SetPVarInt(playerid"ShakeOffer"501);
               }
               else 
SendClientMessage(playeridCOLOR_GREY"You havent been offered for a shake.");
           }
           else if(
strcmp(type"shake8"true) == 0)
           {
               if(
GetPVarInt(playerid"ShakeOffer") != 501)
               {
                   if(
IsPlayerConnected(GetPVarInt(playerid"ShakeOffer")))
                {
                    if(
PlayerToPlayer(playerid,GetPVarInt(playerid"ShakeOffer"),8.0))
                    {
                        
SetPlayerToFacePlayer(playeridGetPVarInt(playerid"ShakeOffer"));
                        
format(sendernamesizeof(sendername), "%s"PlayerNameEx(playerid));
                        
format(giveplayersizeof(giveplayer), "%s"PlayerNameEx(GetPVarInt(playerid"ShakeOffer")));
                          
GiveNameSpace(sendername);
                        
GiveNameSpace(giveplayer);
                        
format(stringsizeof(string), "You accepted %s's handshake."giveplayer);
                           
SendClientMessage(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "%s has accepted your handshake."sendername);
                        
SendClientMessage(GetPVarInt(playerid"ShakeOffer"), COLOR_LIGHTBLUEstring);
                        
ApplyAnimation(playerid,"GANGS","prtial_hndshk_biz_01",4.0,0,0,0,0,0);
                        
ApplyAnimation(GetPVarInt(playerid"ShakeOffer"),"GANGS","prtial_hndshk_biz_01",4.0,0,0,0,0,0);
                        
SetPVarInt(playerid"ShakeOffer"501);
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"You must be around the person who offered the shake.");
                }
                else 
SendClientMessage(playeridCOLOR_GREY"The person who offered a shake is offline."), SetPVarInt(playerid"ShakeOffer"501);
               }
               else 
SendClientMessage(playeridCOLOR_GREY"You havent been offered for a shake.");
           }
    }
    return 
1;

Reply
#4

Nice, but the compiler writes a lot of undefined symbol: /
Reply
#5

Quote:
Originally Posted by FinStar
Посмотреть сообщение
Nice, but the compiler writes a lot of undefined symbol: /
Show me please.
Reply
#6

PlayerToPlayer
GiveNameSpace
PlayerNameEx
SetPlayerToFacePlayer
Reply
#7

These are functions that the compiler writes that are not defined
Reply
#8

I will help u when I get home I am at my phone atm
Reply
#9

Quote:
Originally Posted by Hellman92
Посмотреть сообщение
I will help u when I get home I am at my phone atm

Thank you.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)