Help about Checkpoints and other cmds!!!
#1

Hey Guys i have 2 problems !!

1. I HAVE a script in which when we say /work it shows a red marker and i go on that and it give money and disable checkpoint !!!

But i dont want like that !! I Need when a Player type /work it should show 1st checkpoint and then i go to checkpoint it should show 2nd checkpoint and when i go onto the second checkpoints then it should give me Money !!


2.Guys i made a cmd /stopwork and when i type /stopwork in-game "when u dont have money " it says "You Need $1000 to stop the work" but when the player have money it Just say : "You Have Cancelled the Work ! " And it does not take $1000 from Player !!!!

I Need that when Player is not on /work, it should say "You Need to Be in Work to Stop Work!"

Script:
Code:
#include <a_samp>

public OnPlayerCommandText( playerid, cmdtext[ ] )
{
	if( strcmp( cmdtext, "/work", true ) == 0 )
	{
		if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 519 &&
			GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 592 &&
			GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 577 )
				return SendClientMessage( playerid, 0xFFFFFFFF, "Yor Need to be In A Vehicle to Do work!" );

		SetPlayerCheckpoint( playerid, 1644.4673, -2416.9844, 13.5547, 15.0 );
		return 1;
	}

	if( strcmp( cmdtext, "/stopwork", true ) == 0 )
	{
		if(GetPlayerMoney(playerid) >= 1000)
		{
			DisablePlayerCheckpoint( playerid );
			SendClientMessage(playerid,0xFFFFFFFFF,"You Have Canceled the Work!");
		}
		else
		{
			SendClientMessage(playerid,0xFFFFFFFFF,"You Need $1000 to Cancel the Work!");
		}
		return 1;
	}
	return 0;
}

public OnPlayerEnterCheckpoint( playerid )
{
	GivePlayerMoney( playerid, 10000 );
	DisablePlayerCheckpoint( playerid );
	return 1;
}


Hope you Got it !!! +1 for who helped me !!
Thanks
Reply
#2

pawn Code:
//top of script
new LoadCount[MAX_PLAYERS] = 0;

//commands
    if( strcmp( cmdtext, "/work", true ) == 0 )
    {
        if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 519 &&
            GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 592 &&
            GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 577 )
                return SendClientMessage( playerid, 0xFFFFFFFF, "Yor Need to be In A Vehicle to Do work!" );

        SetPlayerCheckpoint( playerid, 1644.4673, -2416.9844, 13.5547, 15.0 );
        LoadCount[playerid] = 0; // we restart variable
        return 1;
    }

    if( strcmp( cmdtext, "/stopwork", true ) == 0 )
    {
        if(GetPlayerMoney(playerid) >= 1000)
        {
            DisablePlayerCheckpoint( playerid );
            SendClientMessage(playerid,0xFFFFFFFFF,"You Have Canceled the Work!");
            GivePlayerMoney(playerid,-1000); //take $1'000 from him
            LoadCount[playerid] = 0; //we restart variable
        }
        else
        {
            SendClientMessage(playerid,0xFFFFFFFFF,"You Need $1000 to Cancel the Work!");
        }
        return 1;
    }


public OnPlayerEnterCheckpoint(playerid)
{
    LoadCount[playerid]++; //we add one count to his done works
    switch(LoadCount[playerid])
    {
        case 1: //if he did one load
        {
            SetPlayerCheckpoint(...); //this is second CP
        }
        case 2: // if he did 2 loads
        {
            LoadCount[playerid] = 0; //we return count to 0
            // rest of your code here when he finishes 2 loads
        }
    }
    return 1;
}
Reply
#3

Code:
//top of script
#include <a_samp>

new LoadCount[MAX_PLAYERS] = 0;

//commands
    if( strcmp( cmdtext, "/work", true ) == 0 )
    {
        if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 519 &&
            GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 592 &&
            GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 577 )
                return SendClientMessage( playerid, 0xFFFFFFFF, "Yor Need to be In A Vehicle to Do work!" );

        SetPlayerCheckpoint( playerid, 1644.4673, -2416.9844, 13.5547, 15.0 );
        LoadCount[playerid] = 0; // we restart variable
        return 1;
    }

    if( strcmp( cmdtext, "/stopwork", true ) == 0 )
    {
        if(GetPlayerMoney(playerid) >= 1000)
        {
            DisablePlayerCheckpoint( playerid );
            SendClientMessage(playerid,0xFFFFFFFFF,"You Have Canceled the Work!");
            GivePlayerMoney(playerid,-1000); //take $1'000 from him
            LoadCount[playerid] = 0; //we restart variable
        }
        else
        {
            SendClientMessage(playerid,0xFFFFFFFFF,"You Need $1000 to Cancel the Work!");
        }
        return 1;
    }


public OnPlayerEnterCheckpoint(playerid)
{
    LoadCount[playerid]++; //we add one count to his done works
    switch(LoadCount[playerid])
    {
        case 1: //if he did one load
        {
            SetPlayerCheckpoint(1577.2006,1504.4862,10.8342,328.6342); //this is second CP
        }
        case 2: // if he did 2 loads
        {
            LoadCount[playerid] = 0; //we return count to 0
            // rest of your code here when he finishes 2 loads
        }
    }
    return 1;
}
Errors:
Code:
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(7) : error 010: invalid function or declaration
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(9) : error 010: invalid function or declaration
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(12) : error 010: invalid function or declaration
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(14) : error 021: symbol already defined: "SetPlayerCheckpoint"
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(16) : error 010: invalid function or declaration
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(19) : error 010: invalid function or declaration
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(21) : error 010: invalid function or declaration
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(28) : error 010: invalid function or declaration
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(32) : error 010: invalid function or declaration
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(43) : warning 213: tag mismatch
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(43) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


9 Errors.
!!!hELP
Reply
#4

WTF! man add the commands under public
pawn Code:
OnPlayerCommandText( playerid, cmdtext[ ] )
pawn Code:
//top of script
#include <a_samp>

new LoadCount[MAX_PLAYERS] = 0;

//commands
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( strcmp( cmdtext, "/work", true ) == 0 )
    {
        if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 519 &&
            GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 592 &&
            GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 577 )
                return SendClientMessage( playerid, 0xFFFFFFFF, "Yor Need to be In A Vehicle to Do work!" );

        SetPlayerCheckpoint( playerid, 1644.4673, -2416.9844, 13.5547, 15.0 );
        LoadCount[playerid] = 0; // we restart variable
        return 1;
    }

    if( strcmp( cmdtext, "/stopwork", true ) == 0 )
    {
        if(GetPlayerMoney(playerid) >= 1000)
        {
            DisablePlayerCheckpoint( playerid );
            SendClientMessage(playerid,0xFFFFFFFFF,"You Have Canceled the Work!");
            GivePlayerMoney(playerid,-1000); //take $1'000 from him
            LoadCount[playerid] = 0; //we restart variable
        }
        else
        {
            SendClientMessage(playerid,0xFFFFFFFFF,"You Need $1000 to Cancel the Work!");
        }
        return 1;
    }
    return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
    LoadCount[playerid]++; //we add one count to his done works
    switch(LoadCount[playerid])
    {
        case 1: //if he did one load
        {
            SetPlayerCheckpoint(playerid, 1577.2006,1504.4862,10.8342,328.6342); //this is second CP
        }
        case 2: // if he did 2 loads
        {
            LoadCount[playerid] = 0; //we return count to 0
            // rest of your code here when he finishes 2 loads
        }
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Faisal_khan
View Post
WTF! man add the commands under public
pawn Code:
OnPlayerCommandText( playerid, cmdtext[ ] )
pawn Code:
//top of script
#include <a_samp>

new LoadCount[MAX_PLAYERS] = 0;

//commands
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( strcmp( cmdtext, "/work", true ) == 0 )
    {
        if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 519 &&
            GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 592 &&
            GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 577 )
                return SendClientMessage( playerid, 0xFFFFFFFF, "Yor Need to be In A Vehicle to Do work!" );

        SetPlayerCheckpoint( playerid, 1644.4673, -2416.9844, 13.5547, 15.0 );
        LoadCount[playerid] = 0; // we restart variable
        return 1;
    }

    if( strcmp( cmdtext, "/stopwork", true ) == 0 )
    {
        if(GetPlayerMoney(playerid) >= 1000)
        {
            DisablePlayerCheckpoint( playerid );
            SendClientMessage(playerid,0xFFFFFFFFF,"You Have Canceled the Work!");
            GivePlayerMoney(playerid,-1000); //take $1'000 from him
            LoadCount[playerid] = 0; //we restart variable
        }
        else
        {
            SendClientMessage(playerid,0xFFFFFFFFF,"You Need $1000 to Cancel the Work!");
        }
        return 1;
    }
    return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
    LoadCount[playerid]++; //we add one count to his done works
    switch(LoadCount[playerid])
    {
        case 1: //if he did one load
        {
            SetPlayerCheckpoint(1577.2006,1504.4862,10.8342,328.6342); //this is second CP
        }
        case 2: // if he did 2 loads
        {
            LoadCount[playerid] = 0; //we return count to 0
            // rest of your code here when he finishes 2 loads
        }
    }
    return 1;
}
Warnings:
Code:
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(46) : warning 213: tag mismatch
C:\Documents and Settings\User\Desktop\testing server\filterscripts\work.pwn(46) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#6

I thought you know that atleast...
Reply
#7

Sorry for double Post !! Fixed !!
U didnt add SetPlayerCheckpoint(playerid,...) Lol

Thanks heres +1 for y
Reply
#8

never mind
Reply
#9

pawn Code:
//top of script
#include <a_samp>

new LoadCount[MAX_PLAYERS] = 0;

//commands
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if( strcmp( cmdtext, "/work", true ) == 0 )
    {
        if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 519 &&
            GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 592 &&
            GetVehicleModel( GetPlayerVehicleID( playerid ) ) != 577 )
                return SendClientMessage( playerid, 0xFFFFFFFF, "Yor Need to be In A Vehicle to Do work!" );

        SetPlayerCheckpoint( playerid, 1644.4673, -2416.9844, 13.5547, 15.0 );
        LoadCount[playerid] = 0; // we restart variable
        return 1;
    }

    if( strcmp( cmdtext, "/stopwork", true ) == 0 )
    {
        if(GetPlayerMoney(playerid) >= 1000)
        {
            DisablePlayerCheckpoint( playerid );
            SendClientMessage(playerid,0xFFFFFFFFF,"You Have Canceled the Work!");
            GivePlayerMoney(playerid,-1000); //take $1'000 from him
            LoadCount[playerid] = 0; //we restart variable
        }
        else
        {
            SendClientMessage(playerid,0xFFFFFFFFF,"You Need $1000 to Cancel the Work!");
        }
        return 1;
    }
    return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
    LoadCount[playerid]++; //we add one count to his done works
    switch(LoadCount[playerid])
    {
        case 1: //if he did one load
        {
            SetPlayerCheckpoint(playerid, 1577.2006,1504.4862,10.8342,328.6342); //this is second CP
        }
        case 2: // if he did 2 loads
        {
            LoadCount[playerid] = 0; //we return count to 0
            // rest of your code here when he finishes 2 loads
        }
    }
    return 1;
}
The problem was you did not added playerid in :
pawn Code:
SetPlayerCheckpoint(playerid, 1577.2006,1504.4862,10.8342,328.6342);
Reply
#10

Hey problem !! when i go on 2nd checkpoint it dont give me any Money !!
can u add it like give money between 10000-15000 Thx.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)