SA-MP Forums Archive
What is wrong - 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)
+--- Thread: What is wrong (/showthread.php?tid=338964)



What is wrong - boyan96 - 01.05.2012

My pawno is giving 26 errors


PHP код:
if (strcmp(cmdtext"/lock"true)==0)
    {
    if(
PlayerInfo[playerid][pDonateRank] >= 2)
    {
    print(
"Car locked");
    if(
IsPlayerInAnyVehicle(playerid))
    {
    new 
State=GetPlayerState(playerid);
    if(
State!=PLAYER_STATE_DRIVER)
    {
    
SendClientMessage(playerid,0xFFFF00AA,"You must be an driver to do this.");
    return 
1;
    }
    new 
i;
    for(
i=0;i<MAX_PLAYERS;i++)
    {
    if(
!= playerid)
    {
    
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i01);
    }
    }
    
SendClientMessage(playerid0xFFFF00AA"Car locked!");
    new 
Float:pXFloat:pYFloat:pZ;
    
GetPlayerPos(playerid,pX,pY,pZ);
    
PlayerPlaySound(playerid,1056,pX,pY,pZ);
    }
    else
    {
    
SendClientMessage(playerid0xFFFF00AA"You don't have an car.");
    }
    return 
1;
    } 
PHP код:
  if (strcmp(cmdtext"/unlock"true)==0)
    {
    if(
PlayerInfo[playerid][pDonateRank] >= 2)
    {
    print(
"Car unlocked");
    if(
IsPlayerInAnyVehicle(playerid))
    {
    new 
State=GetPlayerState(playerid);
    if(
State!=PLAYER_STATE_DRIVER)
    {
    
SendClientMessage(playerid,0xFFFF00AA,"You must be an driver to do this.");
    return 
1;
    }
    new 
i;
    for(
i=0;i<MAX_PLAYERS;i++)
    {
    
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i00);
    }
    
SendClientMessage(playerid0xFFFF00AA"Car unlocked.");
    new 
Float:pXFloat:pYFloat:pZ;
    
GetPlayerPos(playerid,pX,pY,pZ);
    
PlayerPlaySound(playerid,1057,pX,pY,pZ);
    }
    else
    {
    
SendClientMessage(playerid0xFFFF00AA"You don't have an car.");
    }
    return 
1;
    } 



Re: What is wrong - Sphex - 01.05.2012

Can we see the errors?


Re: What is wrong - Passout - 01.05.2012

Quote:
Originally Posted by Sphex
Посмотреть сообщение
Can we see the errors?
Ye,there is no way we can help without the errors or the problem you are experiencing


Re : What is wrong - Shidony - 01.05.2012

pawn Код:
if (strcmp(cmdtext, "/unlock", true)==0)
{
    if(PlayerInfo[playerid][pDonateRank] >= 2)
    {
        print("Car unlocked");
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,0xFFFF00AA,"You must be an driver to do this.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
            }
            SendClientMessage(playerid, 0xFFFF00AA, "Car unlocked.");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid,1057,pX,pY,pZ);
        }
        else
        {
            SendClientMessage(playerid, 0xFFFF00AA, "You don't have an car.");
        }
        return 1;
    }
}
pawn Код:
if (strcmp(cmdtext, "/lock", true)==0)
{
    if(PlayerInfo[playerid][pDonateRank] >= 2)
    {
        print("Car locked");
        if(IsPlayerInAnyVehicle(playerid))
        {
            new State=GetPlayerState(playerid);
            if(State!=PLAYER_STATE_DRIVER)
            {
                SendClientMessage(playerid,0xFFFF00AA,"You must be an driver to do this.");
                return 1;
            }
            new i;
            for(i=0;i<MAX_PLAYERS;i++)
            {
                if(i != playerid)
                {
                    SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
                }
            }
            SendClientMessage(playerid, 0xFFFF00AA, "Car locked!");
            new Float:pX, Float:pY, Float:pZ;
            GetPlayerPos(playerid,pX,pY,pZ);
            PlayerPlaySound(playerid,1056,pX,pY,pZ);
        }
        else
        {
            SendClientMessage(playerid, 0xFFFF00AA, "You don't have an car.");
        }
            return 1;
    }
}
Two times the same error (one bracket missing)

Quote:
Originally Posted by Passout
Посмотреть сообщение
Ye,there is no way we can help without the errors or the problem you are experiencing
26 errors is bracket missing