SA-MP Forums Archive
This is not working [Need help Urgent] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: This is not working [Need help Urgent] (/showthread.php?tid=277956)



This is not working [Need help Urgent] - $India$ - 20.08.2011

This is my Code.

pawn Code:
CMD:assist(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new PyrID;
        if(sscanf(params, "d", PyrID))
        {
            SendClientMessage(playerid, ERROR,"Usage: /assist [Playerid]");
        }
        {

            if(IsPlayerConnected(PyrID))
            {
                if(PlayerInfo[playerid][pAssisting] == 1)
                {
                    PlayerInfo[playerid][pAssisting] == 1;
                    PlayerInfo[PyrID][pGettingAssisted] == 1;
                    {
                        SendClientMessage(playerid, ERROR,"You are now assisting");
                        SendClientMessage(PyrID, ERROR,"You are getting assisted by an Admin, Type /ac to talk to an admin.");
                    }
                }
                else SendClientMessage(playerid, ERROR,"You are already assisting.");
            }
            else SendClientMessage(playerid, ERROR,"Invalid Player.");
        }

    }
    else SendClientMessage(playerid, ERROR,"You are not authorized to use that command.");
    return 1;
}
Its not Working please help me.


Re: This is not working [Need help Urgent] - emokidx - 20.08.2011

pawn Code:
if(PlayerInfo[playerid][pAssisting] == 0)
                 {
                    PlayerInfo[playerid][pAssisting] == 1;
                    PlayerInfo[PyrID][pGettingAssisted] == 1;
//......
it should not be 1.. it should be 0,, i think


Re: This is not working [Need help Urgent] - $India$ - 20.08.2011

Code:
F:\My Server\Server\gamemodes\Gamemode.pwn(1058) : warning 215: expression has no effect
F:\My Server\Server\gamemodes\Gamemode.pwn(1059) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
How to fix these warnings?


Re: This is not working [Need help Urgent] - emokidx - 20.08.2011

in this code only? or is it some other code?


Re: This is not working [Need help Urgent] - linuxthefish - 20.08.2011

Quote:
Originally Posted by $India$
View Post
Code:
F:\My Server\Server\gamemodes\Gamemode.pwn(1058) : warning 215: expression has no effect
F:\My Server\Server\gamemodes\Gamemode.pwn(1059) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
How to fix these warnings?
You can't just paste your errors and expect people to know the answer. Show some code!


Re: This is not working [Need help Urgent] - $India$ - 20.08.2011

In this Code.. And its Not Working Properly At all.


Re: This is not working [Need help Urgent] - emokidx - 20.08.2011

pawn Code:
CMD:assist(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new PyrID, pname[128];
        GetPlayerName(PlyID, pname, sizeof(pname));
        if(sscanf(params, "u", PyrID))
        {
            SendClientMessage(playerid, ERROR,"Usage: /assist [Playerid]");
        }
        {

            if(IsPlayerConnected(PyrID))
            {
                if(PlayerInfo[playerid][pAssisting] == 0)
                {
                    PlayerInfo[playerid][pAssisting] == 1;
                    PlayerInfo[PyrID][pGettingAssisted] == 1;
                    {
                        SendClientMessage(playerid, ERROR,"You are now assisting");
                        SendClientMessage(PyrID, ERROR,"You are getting assisted by an Admin, Type /ac to talk to an admin.");
                    }
                }
                else SendClientMessage(playerid, ERROR,"You are already assisting.");
            }
            else SendClientMessage(playerid, ERROR,"Invalid Player.");
        }

    }
    else SendClientMessage(playerid, ERROR,"You are not authorized to use that command.");
    return 1;
}
i think you need to define the ID's


Re: This is not working [Need help Urgent] - $India$ - 20.08.2011

But i am getting this Warnings

F:\My Server\Server\gamemodes\Gamemode.pwn(1060) : warning 215: expression has no effect
F:\My Server\Server\gamemodes\Gamemode.pwn(1061) : warning 215: expression has no effect


Re: This is not working [Need help Urgent] - emokidx - 20.08.2011

pawn Code:
CMD:assist(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] >= 1)
    {
        new PyrID, pname[128];
        GetPlayerName(PyrID, pname, sizeof(pname));
        if(sscanf(params, "u", PyrID))
        {
            SendClientMessage(playerid, red,"Usage: /assist [Playerid]");
        }
        if(IsPlayerConnected(PyrID))
            {
                if(PlayerInfo[playerid][pAssisting] == 0)
                {
                    PlayerInfo[playerid][pAssisting] = 1;
                    PlayerInfo[PyrID][pGettingAssisted] = 1;
                    {
                        SendClientMessage(playerid, red,"You are now assisting");
                        SendClientMessage(PyrID, red,"You are getting assisted by an Admin, Type /ac to talk to an admin.");
                    }
                }
                else SendClientMessage(playerid, red,"You are already assisting.");
            }
            else SendClientMessage(playerid, red,"Invalid Player.");


    }
    else SendClientMessage(playerid, red,"You are not authorized to use that command.");
    return 1;
}



Re: This is not working [Need help Urgent] - $India$ - 20.08.2011

Check this its not working Properly

pawn Code:
CMD:assist(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new PyrID, pname[128], name[128], str[128];
        GetPlayerName(PyrID, pname, sizeof(pname));
        GetPlayerName(playerid, name, sizeof(name));
        if(PlayerInfo[playerid][pAssisting] == 1)
        {
            if(PlayerInfo[PyrID][pGettingAssisted] == 1)
            {
                if(sscanf(params, "u", PyrID))
                {
                    SendClientMessage(playerid, ERROR,"Usage: /assist [Playerid]");
                }
                if(IsPlayerConnected(PyrID))
                {

                    PlayerInfo[playerid][pAssisting] = 1;
                    PlayerInfo[PyrID][pGettingAssisted] = 1;
                    {

                        format(str, sizeof(str),"You are assisting %s, Type /ac to talk with that player.", pname);
                        SendClientMessage(playerid, COLOR_YELLOW, str);
                       
                        format(str, sizeof(str), "Admin %s is now assisting you, Type /ac to talk with that Admin.", name);
                        SendClientMessage(PyrID, COLOR_YELLOW, str);
                    }
                }
                else SendClientMessage(playerid, ERROR,"Invalid Player.");
            }
            else SendClientMessage(playerid, ERROR,"That player is already getting assisted by another admin.");
        }
        else SendClientMessage(playerid, ERROR,"You are already assisting");
    }
    else SendClientMessage(playerid, ERROR,"You are not authorized to use that command.");
    return 1;
}

CMD:endassist(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new PyrID, name[128], pname[128], str[128];
        GetPlayerName(playerid, name, sizeof(name));
        GetPlayerName(PyrID, pname, sizeof(pname));
        if(PlayerInfo[playerid][pAssisting] == 0)
        {
            if(PlayerInfo[PyrID][pGettingAssisted] == 0)
            {
                if(sscanf(params,"u", PyrID))
                {
                    SendClientMessage(playerid, ERROR,"Usage: /endassist [Playerid]");
                }
                if(IsPlayerConnected(PyrID))
                {
                    PlayerInfo[playerid][pAssisting] = 0;
                    PlayerInfo[PyrID][pGettingAssisted] = 0;
                    {
                        format(str, sizeof(str),"Admin %s has ended your assistance", name);
                        SendClientMessage(PyrID, COLOR_YELLOW, str);

                        format(str, sizeof(str),"You have ended the assistance of %s", pname);
                        SendClientMessage(playerid, COLOR_YELLOW, str);
                    }
                }
                else SendClientMessage(playerid, ERROR,"Invalid Player.");
            }
            else SendClientMessage(playerid, ERROR,"That player is not getting assisted by anyone.");
        }
        else SendClientMessage(playerid, ERROR,"You are not assisting anyone.");
    }
    else SendClientMessage(playerid, ERROR,"You are not authorized to use that command.");
    return 1;
}