PDA

View Full Version : [Help](Checkpoints Not Disable)And not Reward


astanalol
27/04/2015, 02:08 AM
Hello Guys
My Problems The Checkpoints Race not Disable And The Money and Wanted Not Work!
And Player i Kidnaped him He is not die idk why!
i made his health 0
CMD:kidnap(playerid, params[])
{
new targetid;
if(sscanf(params,"d",targetid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /kidnap [id]");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must be on vehicle!");
if(noexit[targetid] == 1) noexit[targetid] = 0;
noexit[targetid] = 1;
PutPlayerInVehicle(targetid, GetPlayerVehicleID(playerid), 1);
new rand = random(sizeof (NextKidnapp));
SetPlayerRaceCheckpoint(playerid, 2, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.0, 0.0, 0.0, 5.0);
SendClientMessage(targetid, COLOR_RED, "You Can Out /cutrope");

new String[128];

format(String, sizeof(String), "You kidnapped %s", pName(targetid));
GameTextForPlayer(playerid, String, 5000, 4);

//for Victim:
format(String, sizeof(String), "You kidnaped From %s", pName(playerid));
GameTextForPlayer(targetid, String, 5000, 4);

return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
if (Player_NextKidnapp{playerid})
{
Player_NextKidnapp{playerid} = false;

DisablePlayerRaceCheckpoint(playerid);
SetPlayerHealth(Player_NextKidnapp[playerid], 0);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 25000+random(113452));
return 1;
}
return 1;
}

help +1 Repsss

fuckingcruse
27/04/2015, 02:30 AM
Everything looks good.. what's the problem then?

astanalol
27/04/2015, 03:00 AM
Everything looks good.. what's the problem then?

idk all this not give me the money and not disable the race checkpoints :/
DisablePlayerRaceCheckpoint(playerid);
SetPlayerHealth(Player_NextKidnapp[playerid], 0);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 25000+random(113452));
its not do any things when im in The Checkpoints Race from this Code :/
idk why

trablon
27/04/2015, 03:33 AM
- Ohh buddy, you forgot to add your command(kidnap) Player_NextKidnapp[playerid] = true;
Just add it and it will be work.Without editing the variable, checkpoint cannot figure out that you are near the checkpoint.
:)

astanalol
27/04/2015, 09:16 AM
- Ohh buddy, you forgot to add your command(kidnap) Player_NextKidnapp[playerid] = true;
Just add it and it will be work.Without editing the variable, checkpoint cannot figure out that you are near the checkpoint.
:)

public OnPlayerEnterRaceCheckpoint(playerid)
{
if (Player_NextKidnapp{playerid})
{
Player_NextKidnapp{playerid} = true;

DisablePlayerRaceCheckpoint(playerid);
SetPlayerHealth(Player_NextKidnapp[playerid], 0);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 25000+random(113452));
return 1;
}
return 1;
}
Changed To True Not Fixed :/

[KHK]Khalid
27/04/2015, 09:42 AM
public OnPlayerEnterRaceCheckpoint(playerid)
{
if (Player_NextKidnapp{playerid})
{
Player_NextKidnapp{playerid} = true;

DisablePlayerRaceCheckpoint(playerid);
SetPlayerHealth(Player_NextKidnapp[playerid], 0);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 25000+random(113452));
return 1;
}
return 1;
}
Changed To True Not Fixed :/

1. He said in the command 'CMD:kindnap', not in OnPlayerEnterRaceCheckpoint.


CMD:kidnap(playerid, params[])
{
new targetid;
if(sscanf(params,"d",targetid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /kidnap [id]");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must be on vehicle!");
if(noexit[targetid] == 1) noexit[targetid] = 0;
noexit[targetid] = 1;
PutPlayerInVehicle(targetid, GetPlayerVehicleID(playerid), 1);
new rand = random(sizeof (NextKidnapp));
SetPlayerRaceCheckpoint(playerid, 2, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.0, 0.0, 0.0, 5.0);
SendClientMessage(targetid, COLOR_RED, "You Can Out /cutrope");

new String[128];

format(String, sizeof(String), "You kidnapped %s", pName(targetid));
GameTextForPlayer(playerid, String, 5000, 4);

//for Victim:
format(String, sizeof(String), "You kidnaped From %s", pName(playerid));
GameTextForPlayer(targetid, String, 5000, 4);

Player_NextKidnapp[playerid] = true;
return 1;
}



2. Be careful and don't make the same mistake in your /cutrope command, it should be something like this:


CMD:cutrope(playerid, params[])
{
// code here
Player_NextKidnapp[playerid] = false;
// more code here?

return 1;
}


3. Do you realize the difference between Player_NextKidnapp[playerid] and Player_NextKidnapp{playerid}? I doubt that by the look of how you use them under OnPlayerEnterRaceCheckpoint.

astanalol
27/04/2015, 10:48 AM
Khalid;3442423']1. He said in the command 'CMD:kindnap', not in OnPlayerEnterRaceCheckpoint.


CMD:kidnap(playerid, params[])
{
new targetid;
if(sscanf(params,"d",targetid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /kidnap [id]");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must be on vehicle!");
if(noexit[targetid] == 1) noexit[targetid] = 0;
noexit[targetid] = 1;
PutPlayerInVehicle(targetid, GetPlayerVehicleID(playerid), 1);
new rand = random(sizeof (NextKidnapp));
SetPlayerRaceCheckpoint(playerid, 2, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.0, 0.0, 0.0, 5.0);
SendClientMessage(targetid, COLOR_RED, "You Can Out /cutrope");

new String[128];

format(String, sizeof(String), "You kidnapped %s", pName(targetid));
GameTextForPlayer(playerid, String, 5000, 4);

//for Victim:
format(String, sizeof(String), "You kidnaped From %s", pName(playerid));
GameTextForPlayer(targetid, String, 5000, 4);

Player_NextKidnapp[playerid] = true;
return 1;
}



2. Be careful and don't make the same mistake in your /cutrope command, it should be something like this:


CMD:cutrope(playerid, params[])
{
// code here
Player_NextKidnapp[playerid] = false;
// more code here?

return 1;
}


3. Do you realize the difference between Player_NextKidnapp[playerid] and Player_NextKidnapp{playerid}? I doubt that by the look of how you use them under OnPlayerEnterRaceCheckpoint.

Still Not Working.....
im in checkpoints and not take the money or wanted or the kidnaped dead still not fixed :/
Atklm 3rby 3adi :D

astanalol
27/04/2015, 05:43 PM
dude where u?

sammp
27/04/2015, 05:48 PM
Show me your definition for Player_NextKidnapp..

Because I'm pretty sure you're only meant to use curly brackets in const variables and I highly suspect you haven't got a const

astanalol
27/04/2015, 06:00 PM
Show me your definition for Player_NextKidnapp..

Because I'm pretty sure you're only meant to use curly brackets in const variables and I highly suspect you haven't got a const

all script Kidnap :D
new bool: Player_NextKidnapp[MAX_PLAYERS char];
new noexit[MAX_PLAYERS];
new Float:NextKidnapp[][3] = /// change the next POS
{
{213.8458,1867.2299,13.1406},
{404.7588,2443.3687,16.5000},
{760.2078,381.6906,23.1719},
{-777.8541,1436.0165,13.7891}
};


stock pName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}

public OnPlayerConnect(playerid)
{
Player_NextKidnapp{playerid} = false;
return 1;
}
CMD:kidnap(playerid, params[])
{
new targetid;
if(sscanf(params,"d",targetid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /kidnap [id]");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must be on vehicle!");
if(noexit[targetid] == 1) noexit[targetid] = 0;
noexit[targetid] = 1;
PutPlayerInVehicle(targetid, GetPlayerVehicleID(playerid), 1);
new rand = random(sizeof (NextKidnapp));
SetPlayerRaceCheckpoint(playerid, 2, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.0, 0.0, 0.0, 5.0);
SendClientMessage(targetid, COLOR_RED, "You Can Out /cutrope");

new String[128];

format(String, sizeof(String), "You kidnapped %s", pName(targetid));
GameTextForPlayer(playerid, String, 5000, 4);

//for Victim:
format(String, sizeof(String), "You kidnaped From %s", pName(playerid));
GameTextForPlayer(targetid, String, 5000, 4);

Player_NextKidnapp[playerid] = true;
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
if (Player_NextKidnapp{playerid})
{
Player_NextKidnapp{playerid} = true;

DisablePlayerRaceCheckpoint(playerid);
SetPlayerHealth(Player_NextKidnapp[playerid], 0);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 25000+random(113452));
return 1;
}
return 1;
}

[KHK]Khalid
27/04/2015, 07:19 PM
all script Kidnap :D
new bool: Player_NextKidnapp[MAX_PLAYERS char];
new noexit[MAX_PLAYERS];
new Float:NextKidnapp[][3] = /// change the next POS
{
{213.8458,1867.2299,13.1406},
{404.7588,2443.3687,16.5000},
{760.2078,381.6906,23.1719},
{-777.8541,1436.0165,13.7891}
};


stock pName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}

public OnPlayerConnect(playerid)
{
Player_NextKidnapp{playerid} = false;
return 1;
}
CMD:kidnap(playerid, params[])
{
new targetid;
if(sscanf(params,"d",targetid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /kidnap [id]");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must be on vehicle!");
if(noexit[targetid] == 1) noexit[targetid] = 0;
noexit[targetid] = 1;
PutPlayerInVehicle(targetid, GetPlayerVehicleID(playerid), 1);
new rand = random(sizeof (NextKidnapp));
SetPlayerRaceCheckpoint(playerid, 2, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.0, 0.0, 0.0, 5.0);
SendClientMessage(targetid, COLOR_RED, "You Can Out /cutrope");

new String[128];

format(String, sizeof(String), "You kidnapped %s", pName(targetid));
GameTextForPlayer(playerid, String, 5000, 4);

//for Victim:
format(String, sizeof(String), "You kidnaped From %s", pName(playerid));
GameTextForPlayer(targetid, String, 5000, 4);

Player_NextKidnapp[playerid] = true;
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
if (Player_NextKidnapp{playerid})
{
Player_NextKidnapp{playerid} = true;

DisablePlayerRaceCheckpoint(playerid);
SetPlayerHealth(Player_NextKidnapp[playerid], 0);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 25000+random(113452));
return 1;
}
return 1;
}

Using char arrays? Cool then use braces! Here's a rewrite:


new bool: Player_NextKidnapp[MAX_PLAYERS char];
new noexit[MAX_PLAYERS];
new Float:NextKidnapp[][3] = /// change the next POS
{
{213.8458,1867.2299,13.1406},
{404.7588,2443.3687,16.5000},
{760.2078,381.6906,23.1719},
{-777.8541,1436.0165,13.7891}
};


stock pName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}

public OnPlayerConnect(playerid)
{
Player_NextKidnapp{playerid} = false;
return 1;
}
CMD:kidnap(playerid, params[])
{
new targetid;
if(sscanf(params,"d",targetid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /kidnap [id]");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must be on vehicle!");
if(noexit[targetid] == 1) noexit[targetid] = 0;
noexit[targetid] = 1;
PutPlayerInVehicle(targetid, GetPlayerVehicleID(playerid), 1);
new rand = random(sizeof (NextKidnapp));
SetPlayerRaceCheckpoint(playerid, 2, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.0, 0.0, 0.0, 5.0);
SendClientMessage(targetid, COLOR_RED, "You Can Out /cutrope");

new String[128];

format(String, sizeof(String), "You kidnapped %s", pName(targetid));
GameTextForPlayer(playerid, String, 5000, 4);

//for Victim:
format(String, sizeof(String), "You kidnaped From %s", pName(playerid));
GameTextForPlayer(targetid, String, 5000, 4);

Player_NextKidnapp{playerid} = true;
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
if(Player_NextKidnapp{playerid})
{
Player_NextKidnapp{playerid} = false;

DisablePlayerRaceCheckpoint(playerid);
//SetPlayerHealth(Player_NextKidnapp{playerid}, 0); WUUT?? Player_NextKidnapp is a boolean, why using it as a full integer? Maybe you meant this, look below
SetPlayerHealth(playerid, 0); // This kills the player as soon as he enters CP
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 25000+random(113452));
return 1;
}
return 1;
}

astanalol
27/04/2015, 07:24 PM
SetPlayerHealth(playerid, 0);
this will killed me i want kill the kidnaped i kidnap him i want killed him not me :D

[KHK]Khalid
27/04/2015, 08:37 PM
Then assign the kidnapped player id to some variable..


new bool: Player_NextKidnapp[MAX_PLAYERS char];
new KidnappedPlayerID[MAX_PLAYERS];
new noexit[MAX_PLAYERS];
new Float:NextKidnapp[][3] = /// change the next POS
{
{213.8458,1867.2299,13.1406},
{404.7588,2443.3687,16.5000},
{760.2078,381.6906,23.1719},
{-777.8541,1436.0165,13.7891}
};


stock pName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}

public OnPlayerConnect(playerid)
{
Player_NextKidnapp{playerid} = false;
return 1;
}
CMD:kidnap(playerid, params[])
{
new targetid;
if(sscanf(params,"d",targetid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /kidnap [id]");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You must be on vehicle!");
if(noexit[targetid] == 1) noexit[targetid] = 0;
noexit[targetid] = 1;
PutPlayerInVehicle(targetid, GetPlayerVehicleID(playerid), 1);
new rand = random(sizeof (NextKidnapp));
SetPlayerRaceCheckpoint(playerid, 2, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.0, 0.0, 0.0, 5.0);
SendClientMessage(targetid, COLOR_RED, "You Can Out /cutrope");

new String[19 + MAX_PLAYER_NAME]; // Wouldn't memory feel better if we do this than 128? http://www.javascriptkit.com/script/script2/charcount.shtml

format(String, sizeof(String), "You kidnapped %s", pName(targetid));
GameTextForPlayer(playerid, String, 5000, 4);

//for Victim:
format(String, sizeof(String), "You kidnaped From %s", pName(playerid));
GameTextForPlayer(targetid, String, 5000, 4);

Player_NextKidnapp{playerid} = true;
KidnappedPlayerID[playerid] = targetid; // store the kidnapped player id in a variable
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
if(Player_NextKidnapp{playerid})
{
Player_NextKidnapp{playerid} = false;

DisablePlayerRaceCheckpoint(playerid);
SetPlayerHealth(KidnappedPlayerID[playerid], 0); // Kills the kidnapped player id which we have previously stored
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 25000+random(113452));
return 1;
}
return 1;
}