command zcmd
#1

Can you please pass order zcmd + Sscanf?
Код:
if(strcmp(cmd, "/live", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
			{
			    if(TalkingLive[playerid] != 255)
			    {
			        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Live Conversation terminata.");
			        SendClientMessage(TalkingLive[playerid], COLOR_LIGHTBLUE, "* Live Conversation s-a terminat.");
			        TogglePlayerControllable(playerid, 1);
			        TogglePlayerControllable(TalkingLive[playerid], 1);
		            TalkingLive[TalkingLive[playerid]] = 255;
			        TalkingLive[playerid] = 255;
			        return 1;
			    }
			    if(PlayerInfo[playerid][pRank] < 3)
				{
				    SendClientMessage(playerid, COLOR_GREY, "   You need rank 3+ !");
				    return 1;
				}
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD1, "{00FF00}Folosire:{FFFFFF} /live [playerid/numejucator]");
					return 1;
				}
				//giveplayerid = strval(tmp);
		        giveplayerid = ReturnUser(tmp);
				if (IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
						if (ProxDetectorS(5.0, playerid, giveplayerid))
						{
						    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Talk Live with yourself!"); return 1; }
						    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
							GetPlayerName(playerid, sendername, sizeof(sendername));
							format(string, sizeof(string), "* L-ai invitat pe  %s la o Live Conversation.", giveplayer);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "* %s te-a invitat sa aveti o conversatie Live.  (/accept live)", sendername);
							SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
							LiveOffer[giveplayerid] = playerid;
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "   Esti departe de jucator!");
						    return 1;
						}
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "   Invalid ID/Name !");
				    return 1;
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "  Nu esti membru Kanal D.");
			}
		}//not connected
		return 1;
	}
Reply
#2

uppp
Reply
#3

pawn Код:
CMD:live(playerid, var[])
{
   new giveplayerid;
   if(IsPlayerConnected(playerid))
   {
            if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
            {
                if(TalkingLive[playerid] != 255)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Live Conversation terminata.");
                    SendClientMessage(TalkingLive[playerid], COLOR_LIGHTBLUE, "* Live Conversation s-a terminat.");
                    TogglePlayerControllable(playerid, 1);
                    TogglePlayerControllable(TalkingLive[playerid], 1);
                    TalkingLive[TalkingLive[playerid]] = 255;
                    TalkingLive[playerid] = 255;
                    return 1;
                }
                if(PlayerInfo[playerid][pRank] < 3)
                {
                    SendClientMessage(playerid, COLOR_GREY, "   You need rank 3+ !");
                    return 1;
                }
                if(sscanf(var, "u", giveplayerid))
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "{00FF00}Folosire:{FFFFFF} /live [playerid/numejucator]");
                    return 1;
                }
                if (IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if (ProxDetectorS(5.0, playerid, giveplayerid))
                        {
                            if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Talk Live with yourself!"); return 1; }
                            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            format(string, sizeof(string), "* L-ai invitat pe  %s la o Live Conversation.", giveplayer);
                            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                            format(string, sizeof(string), "* %s te-a invitat sa aveti o conversatie Live.  (/accept live)", sendername);
                            SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                            LiveOffer[giveplayerid] = playerid;
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "   Esti departe de jucator!");
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   Invalid ID/Name !");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "  Nu esti membru Kanal D.");
            }
        }
        return 1;
    }
Here you are sir.
Reply
#4

: error 017: undefined symbol "giveplayer"
Reply
#5

adjust
pawn Код:
new giveplayerid;
with
pawn Код:
new giveplayerid, giveplayer[32];
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)