[Help](Checkpoints Not Disable)And not Reward
#1

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
PHP код:
CMD:kidnap(playeridparams[])
{
    new 
targetid;
    if(
sscanf(params,"d",targetid)) return SendClientMessage(playerid0xFF0000FF"USAGE: /kidnap [id]");
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid0xFF0000FF"ERROR: You must be on vehicle!");
    if(
noexit[targetid] == 1noexit[targetid] = 0;
    
noexit[targetid] = 1;
    
PutPlayerInVehicle(targetidGetPlayerVehicleID(playerid), 1);
    new 
rand random(sizeof (NextKidnapp));
    
SetPlayerRaceCheckpoint(playerid2NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.00.00.05.0);
    
SendClientMessage(targetidCOLOR_RED"You Can Out /cutrope");
    new 
String[128];
    
format(Stringsizeof(String), "You kidnapped %s"pName(targetid));
    
GameTextForPlayer(playeridString50004);
    
//for Victim:
    
format(Stringsizeof(String), "You kidnaped From %s"pName(playerid));
    
GameTextForPlayer(targetidString50004);
    return 
1;
}
public 
OnPlayerEnterRaceCheckpoint(playerid)
{
if (
Player_NextKidnapp{playerid})
{
    
Player_NextKidnapp{playerid} = false;
    
DisablePlayerRaceCheckpoint(playerid);
    
SetPlayerHealth(Player_NextKidnapp[playerid], 0);
    
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid)+6);
    
GivePlayerMoney(playerid25000+random(113452));
    return 
1;
}
return 
1;

help +1 Repsss
Reply
#2

Everything looks good.. what's the problem then?
Reply
#3

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
Everything looks good.. what's the problem then?
idk all this not give me the money and not disable the race checkpoints :/
PHP код:
    DisablePlayerRaceCheckpoint(playerid);
    
SetPlayerHealth(Player_NextKidnapp[playerid], 0);
    
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid)+6);
    
GivePlayerMoney(playerid25000+random(113452)); 
its not do any things when im in The Checkpoints Race from this Code :/
idk why
Reply
#4

- 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.
Reply
#5

Quote:
Originally Posted by trablon
Посмотреть сообщение
- 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.
PHP код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
if (
Player_NextKidnapp{playerid})
{
    
Player_NextKidnapp{playerid} = true;
    
DisablePlayerRaceCheckpoint(playerid);
    
SetPlayerHealth(Player_NextKidnapp[playerid], 0);
    
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid)+6);
    
GivePlayerMoney(playerid25000+random(113452));
    return 
1;
}
return 
1;

Changed To True Not Fixed :/
Reply
#6

Quote:
Originally Posted by astanalol
Посмотреть сообщение
PHP код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
if (
Player_NextKidnapp{playerid})
{
    
Player_NextKidnapp{playerid} = true;
    
DisablePlayerRaceCheckpoint(playerid);
    
SetPlayerHealth(Player_NextKidnapp[playerid], 0);
    
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid)+6);
    
GivePlayerMoney(playerid25000+random(113452));
    return 
1;
}
return 
1;

Changed To True Not Fixed :/
1. He said in the command 'CMD:kindnap', not in OnPlayerEnterRaceCheckpoint.

pawn Код:
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:

pawn Код:
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.
Reply
#7

Quote:
Originally Posted by [KHK]Khalid
Посмотреть сообщение
1. He said in the command 'CMD:kindnap', not in OnPlayerEnterRaceCheckpoint.

pawn Код:
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:

pawn Код:
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
Reply
#8

dude where u?
Reply
#9

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
Reply
#10

Quote:
Originally Posted by sammp
Посмотреть сообщение
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
PHP код:
new boolPlayer_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(playeridnamesizeof(name));
  return 
name;
}
public 
OnPlayerConnect(playerid)
{
    
Player_NextKidnapp{playerid} = false;
    return 
1;
}
CMD:kidnap(playeridparams[])
{
    new 
targetid;
    if(
sscanf(params,"d",targetid)) return SendClientMessage(playerid0xFF0000FF"USAGE: /kidnap [id]");
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid0xFF0000FF"ERROR: You must be on vehicle!");
    if(
noexit[targetid] == 1noexit[targetid] = 0;
    
noexit[targetid] = 1;
    
PutPlayerInVehicle(targetidGetPlayerVehicleID(playerid), 1);
    new 
rand random(sizeof (NextKidnapp));
    
SetPlayerRaceCheckpoint(playerid2NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], 0.00.00.05.0);
    
SendClientMessage(targetidCOLOR_RED"You Can Out /cutrope");
    new 
String[128];
    
format(Stringsizeof(String), "You kidnapped %s"pName(targetid));
    
GameTextForPlayer(playeridString50004);
    
//for Victim:
    
format(Stringsizeof(String), "You kidnaped From %s"pName(playerid));
    
GameTextForPlayer(targetidString50004);
    
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(playeridGetPlayerWantedLevel(playerid)+6);
    
GivePlayerMoney(playerid25000+random(113452));
    return 
1;
}
return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)