PDA

View Full Version : Help


astanalol
18/03/2017, 05:32 PM
hi Guys
i Tired To Make System Robing Like in Video [5:11]
1. 10 Pickups Take it all After that Appear For Him RaceCP To Finish And Get Reward
https://www.*******.com/watch?v=fnK_ysr_PVE
i told you i tired to make it but its appear RaceCP when i Take 1 Pickups only and i cant make like i told you
i have this problem about 2weeks ago | My Code +rep if you help me
new CP[MAX_PLAYERS];

new Ship[11];
new trying;


CMD:robbank(playerid, params[])
{
CP[playerid] = 0;
SendClientMessage(playerid, 0xFF0000, "Finish This Shit");
return 1;
}

public OnGameModeInit()
{
Ship[1] = CreateDynamicPickup(1210, 19, -1454.8569,1489.1010,7.1016,0);
Ship[2] = CreateDynamicPickup(1210, 19, -1428.7382,1490.0945,7.1016,0);
Ship[3] = CreateDynamicPickup(1210, 19, -1402.7249,1486.1351,7.1016,0);
Ship[4] = CreateDynamicPickup(1210, 19, -1382.1962,1480.3761,8.5625,0);
Ship[5] = CreateDynamicPickup(1210, 19, -1382.1962,1480.3761,8.5625,0);
Ship[6] = CreateDynamicPickup(1210, 19, -1376.8267,1492.7152,11.2031,0);
Ship[7] = CreateDynamicPickup(1210, 19, -1390.7821,1483.1436,1.8672,0);
Ship[8] = CreateDynamicPickup(1210, 19, -1434.3047,1483.0374,1.8672,0);
Ship[9] = CreateDynamicPickup(1210, 19, -1424.6499,1491.1248,1.8672,0);
Ship[10] = CreateDynamicPickup(1210, 19, -1381.9700,1498.3158,8.5625,0);
return 1;
}


public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new pID= 0; pID < sizeof(Ship); pID++)//To give same things to all pickups
{
if(CP[playerid] == 0)

if (pickupid == Ship[0] || pickupid == Ship[1] || pickupid == Ship[2] || pickupid == Ship[3] || pickupid == Ship[4] || pickupid == Ship[5] || pickupid == Ship[6] || pickupid == Ship[7] || pickupid == Ship[8] || pickupid == Ship[9] || pickupid == Ship[10] )
{
CP[playerid] = 10;
}
else
{
trying = CreateDynamicRaceCP(0, -2392.9497,2312.1875,-0.1095, -2392.9497,2312.1875,-0.1095, 5.0, -1, -1, playerid, 2000.0);
}
}
return 1;
}

public OnPlayerEnterDynamicRaceCP(playerid, checkpointid)
{
if(checkpointid == trying)//Enter
{
GameTextForPlayer(playerid, "~r~Great You Are Done This Shit!", 5000, 3);
DestroyDynamicRaceCP(trying);
CP[playerid] = -1;
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 40000+random(120000));
}
return 1;
}

Mencent
18/03/2017, 06:25 PM
Hello!

So that I understand this: You must pick up all 10 pickups so that you can get this checkpoint?

astanalol
18/03/2017, 07:17 PM
Hello!

So that I understand this: You must pick up all 10 pickups so that you can get this checkpoint?

yes yes that i mean

Mencent
18/03/2017, 10:07 PM
OK. Try this, please. ;)
new CP[MAX_PLAYERS];

new Ship[10];
new trying;
new EnterShip[MAX_PLAYERS][10],EnterAllShips[MAX_PLAYERS];


CMD:robbank(playerid, params[])
{
CP[playerid] = 0;
SendClientMessage(playerid, 0xFF0000, "Finish This Shit");
return 1;
}

public OnGameModeInit()
{
Ship[0] = CreateDynamicPickup(1210, 19, -1454.8569,1489.1010,7.1016,0);
Ship[1] = CreateDynamicPickup(1210, 19, -1428.7382,1490.0945,7.1016,0);
Ship[2] = CreateDynamicPickup(1210, 19, -1402.7249,1486.1351,7.1016,0);
Ship[3] = CreateDynamicPickup(1210, 19, -1382.1962,1480.3761,8.5625,0);
Ship[4] = CreateDynamicPickup(1210, 19, -1382.1962,1480.3761,8.5625,0);
Ship[5] = CreateDynamicPickup(1210, 19, -1376.8267,1492.7152,11.2031,0);
Ship[6] = CreateDynamicPickup(1210, 19, -1390.7821,1483.1436,1.8672,0);
Ship[7] = CreateDynamicPickup(1210, 19, -1434.3047,1483.0374,1.8672,0);
Ship[8] = CreateDynamicPickup(1210, 19, -1424.6499,1491.1248,1.8672,0);
Ship[9] = CreateDynamicPickup(1210, 19, -1381.9700,1498.3158,8.5625,0);
return 1;
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
for(new pID;pID<sizeof(Ship);pID++)
{
if(pickupid == Ship[pID] && EnterShip[playerid][pID] == 0)
{
EnterShip[playerid][pID] = 1;
EnterAllShips[playerid] ++;
SendClientMessage(playerid,-1,"You pick up a pickup!");
break;
}
}
if(EnterAllShips[playerid] == 10)
{
trying = CreateDynamicRaceCP(0, -2392.9497,2312.1875,-0.1095, -2392.9497,2312.1875,-0.1095, 5.0, -1, -1, playerid, 2000.0);
}
return 1;
}


public OnPlayerEnterDynamicRaceCP(playerid, checkpointid)
{
if(checkpointid == trying)//Enter
{
GameTextForPlayer(playerid, "~r~Great You Are Done This Shit!", 5000, 3);
DestroyDynamicRaceCP(trying);
CP[playerid] = -1;
for(new pID;pID<sizeof(Ship);pID++)EnterShip[playerid][pID] = 0;
EnterAllShips[playerid] = 0;
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 40000+random(120000));
}
return 1;
}

astanalol
18/03/2017, 11:19 PM
OK. Try this, please. ;)
new CP[MAX_PLAYERS];

new Ship[10];
new trying;
new EnterShip[MAX_PLAYERS][10],EnterAllShips[MAX_PLAYERS];


CMD:robbank(playerid, params[])
{
CP[playerid] = 0;
SendClientMessage(playerid, 0xFF0000, "Finish This Shit");
return 1;
}

public OnGameModeInit()
{
Ship[0] = CreateDynamicPickup(1210, 19, -1454.8569,1489.1010,7.1016,0);
Ship[1] = CreateDynamicPickup(1210, 19, -1428.7382,1490.0945,7.1016,0);
Ship[2] = CreateDynamicPickup(1210, 19, -1402.7249,1486.1351,7.1016,0);
Ship[3] = CreateDynamicPickup(1210, 19, -1382.1962,1480.3761,8.5625,0);
Ship[4] = CreateDynamicPickup(1210, 19, -1382.1962,1480.3761,8.5625,0);
Ship[5] = CreateDynamicPickup(1210, 19, -1376.8267,1492.7152,11.2031,0);
Ship[6] = CreateDynamicPickup(1210, 19, -1390.7821,1483.1436,1.8672,0);
Ship[7] = CreateDynamicPickup(1210, 19, -1434.3047,1483.0374,1.8672,0);
Ship[8] = CreateDynamicPickup(1210, 19, -1424.6499,1491.1248,1.8672,0);
Ship[9] = CreateDynamicPickup(1210, 19, -1381.9700,1498.3158,8.5625,0);
return 1;
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
for(new pID;pID<sizeof(Ship);pID++)
{
if(pickupid == Ship[pID] && EnterShip[playerid][pID] == 0)
{
EnterShip[playerid][pID] = 1;
EnterAllShips[playerid] ++;
SendClientMessage(playerid,-1,"You pick up a pickup!");
break;
}
}
if(EnterAllShips[playerid] == 10)
{
trying = CreateDynamicRaceCP(0, -2392.9497,2312.1875,-0.1095, -2392.9497,2312.1875,-0.1095, 5.0, -1, -1, playerid, 2000.0);
}
return 1;
}


public OnPlayerEnterDynamicRaceCP(playerid, checkpointid)
{
if(checkpointid == trying)//Enter
{
GameTextForPlayer(playerid, "~r~Great You Are Done This Shit!", 5000, 3);
DestroyDynamicRaceCP(trying);
CP[playerid] = -1;
for(new pID;pID<sizeof(Ship);pID++)EnterShip[playerid][pID] = 0;
EnterAllShips[playerid] = 0;
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 40000+random(120000));
}
return 1;
}

after i done take all pickups || not showing to me the checkpoints why ?
i tired to change it to showing but its not showing
and > trying = CreateDynamicCP(-2392.9497,2312.1875,-0.1095, 10.10);
and i know good my CP working in old one but in this script bugged idk why :O its not showing after i take all pickups

Mencent
19/03/2017, 07:06 AM
Well, I get this checkpoint. I even tried it with SetPlayerRaceCheckpoint and with your version. Both works.
Do you pick up all 10 pickups? Try it again, please. ;)

astanalol
19/03/2017, 05:14 PM
Well, I get this checkpoint. I even tried it with SetPlayerRaceCheckpoint and with your version. Both works.
Do you pick up all 10 pickups? Try it again, please. ;)

i pick the 10 pickups but see after pick all
only 4 in photo take why ? i swear iam take the 10pickups :( there some pickups not give me this massage only 4 from 10 pickups
http://store6.up-00.com/2017-03/148994297829011.png

Mencent
19/03/2017, 06:01 PM
I believe you that. ;)
We can check this easy. Take this code and show us the server.log when you pick up all 10 pickups. ;)
public OnPlayerPickUpPickup(playerid,pickupid)
{
for(new pID;pID<sizeof(Ship);pID++)
{
if(pickupid == Ship[pID] && EnterShip[playerid][pID] == 0)
{
printf("pickupid: %d - Ship[pID]: %d",pickupid,Ship[pID]);
EnterShip[playerid][pID] = 1;
EnterAllShips[playerid] ++;
SendClientMessage(playerid,-1,"You pick up a pickup!");
break;
}
}
if(EnterAllShips[playerid] == 10)
{
trying = CreateDynamicRaceCP(0, -2392.9497,2312.1875,-0.1095, -2392.9497,2312.1875,-0.1095, 5.0, -1, -1, playerid, 2000.0);
}
return 1;
}

astanalol
19/03/2017, 06:31 PM
I believe you that. ;)
We can check this easy. Take this code and show us the server.log when you pick up all 10 pickups. ;)
public OnPlayerPickUpPickup(playerid,pickupid)
{
for(new pID;pID<sizeof(Ship);pID++)
{
if(pickupid == Ship[pID] && EnterShip[playerid][pID] == 0)
{
printf("pickupid: %d - Ship[pID]: %d",pickupid,Ship[pID]);
EnterShip[playerid][pID] = 1;
EnterAllShips[playerid] ++;
SendClientMessage(playerid,-1,"You pick up a pickup!");
break;
}
}
if(EnterAllShips[playerid] == 10)
{
trying = CreateDynamicRaceCP(0, -2392.9497,2312.1875,-0.1095, -2392.9497,2312.1875,-0.1095, 5.0, -1, -1, playerid, 2000.0);
}
return 1;
}

still problems and 4 pickups only like in photo nothing new :(

Mencent
19/03/2017, 06:36 PM
Yes, you should send me your server.log ;)

astanalol
19/03/2017, 06:51 PM
Yes, you should send me your server.log ;)

[11:40:12] [join] GAVA has joined the server (0:127.0.0.1)
[11:40:12] Iter_OnPlayerConnect: 0
[11:40:12] Iter_OnPlayerConnect end
[11:41:49] pickupid: 7 - Ship[pID]: 7
[11:41:49] pickupid: 8 - Ship[pID]: 8
[11:41:52] pickupid: 9 - Ship[pID]: 9
[11:42:02] pickupid: 10 - Ship[pID]: 10

see :D

Mencent
20/03/2017, 01:16 PM
It's very strange... Do you have only this in OnPlayerPickUpPickup or anything more? ;)

astanalol
20/03/2017, 01:17 PM
It's very strange... Do you have only this in OnPlayerPickUpPickup or anything more? ;)

new CP[MAX_PLAYERS];

new Ship[10];
new trying;
new EnterShip[MAX_PLAYERS][10],EnterAllShips[MAX_PLAYERS];


CMD:robbank(playerid, params[])
{
CP[playerid] = 0;
SendClientMessage(playerid, 0xFF0000, "Finish This Shit");
return 1;
}

public OnGameModeInit()
{
Ship[0] = CreateDynamicPickup(1210, 1, -1454.8569,1489.1010,7.1016,0);
Ship[1] = CreateDynamicPickup(1210, 1, -1428.7382,1490.0945,7.1016,0);
Ship[2] = CreateDynamicPickup(1210, 1, -1402.7249,1486.1351,7.1016,0);
Ship[3] = CreateDynamicPickup(1210, 1, -1382.1962,1480.3761,8.5625,0);
Ship[4] = CreateDynamicPickup(1210, 1, -1382.1962,1480.3761,8.5625,0);
Ship[5] = CreateDynamicPickup(1210, 1, -1376.8267,1492.7152,11.2031,0);
Ship[6] = CreateDynamicPickup(1210, 1, -1390.7821,1483.1436,1.8672,0);
Ship[7] = CreateDynamicPickup(1210, 1, -1434.3047,1483.0374,1.8672,0);
Ship[8] = CreateDynamicPickup(1210, 1, -1424.6499,1491.1248,1.8672,0);
Ship[9] = CreateDynamicPickup(1210, 1, -1381.9700,1498.3158,8.5625,0);
return 1;
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
for(new pID;pID<sizeof(Ship);pID++)
{
if(pickupid == Ship[pID] && EnterShip[playerid][pID] == 0)
{
printf("pickupid: %d - Ship[pID]: %d",pickupid,Ship[pID]);
EnterShip[playerid][pID] = 1;
EnterAllShips[playerid] ++;
SendClientMessage(playerid,-1,"You pick up a pickup!");
break;
}
}
if(EnterAllShips[playerid] == 10)
{
trying = CreateDynamicRaceCP(0, -2392.9497,2312.1875,-0.1095, -2392.9497,2312.1875,-0.1095, 5.0, -1, -1, playerid, 2000.0);
}
return 1;
}


public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == trying)//Enter
{
GameTextForPlayer(playerid, "~r~Great You Are Done This Shit!", 5000, 3);
DestroyDynamicRaceCP(trying);
CP[playerid] = -1;
for(new pID;pID<sizeof(Ship);pID++)EnterShip[playerid][pID] = 0;
EnterAllShips[playerid] = 0;
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+6);
GivePlayerMoney(playerid, 40000+random(120000));
}
return 1;
}

Mencent
20/03/2017, 01:32 PM
You have a double pickup. ;)

Try this:
new CP[MAX_PLAYERS];

new Ship[9];
new trying;
new EnterShip[MAX_PLAYERS][9],EnterAllShips[MAX_PLAYERS];

public OnGameModeInit()
{
Ship[0] = CreatePickup(1210, 19, -1454.8569,1489.1010,7.1016,0);
Ship[1] = CreatePickup(1210, 19, -1428.7382,1490.0945,7.1016,0);
Ship[2] = CreatePickup(1210, 19, -1402.7249,1486.1351,7.1016,0);
Ship[3] = CreatePickup(1210, 19, -1382.1962,1480.3761,8.5625,0);
Ship[4] = CreatePickup(1210, 19, -1376.8267,1492.7152,11.2031,0);
Ship[5] = CreatePickup(1210, 19, -1390.7821,1483.1436,1.8672,0);
Ship[6] = CreatePickup(1210, 19, -1434.3047,1483.0374,1.8672,0);
Ship[7] = CreatePickup(1210, 19, -1424.6499,1491.1248,1.8672,0);
Ship[8] = CreatePickup(1210, 19, -1381.9700,1498.3158,8.5625,0);
return 1;
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
for(new pID;pID<sizeof(Ship);pID++)
{
if(pickupid == Ship[pID] && EnterShip[playerid][pID] == 0)
{
EnterShip[playerid][pID] = 1;
EnterAllShips[playerid] ++;
SendClientMessage(playerid,-1,"You pick up a pickup!");
break;
}
}
if(EnterAllShips[playerid] == 9)
{
trying = CreateDynamicRaceCP(0, -2392.9497,2312.1875,-0.1095, -2392.9497,2312.1875,-0.1095, 5.0, -1, -1, playerid, 2000.0);
}
return 1;
}

astanalol
20/03/2017, 01:43 PM
have small problems this RaceCP not disable and not take the money and wanted omg
my Pos for CP Here -2392.9497,2312.1875,-0.1095

Mencent
20/03/2017, 02:59 PM
Sorry that it took so long but I was still short away. ;)

You have OnPlayerEnterDynamicCP but it has to be OnPlayerEnterDynamicRaceCP. ;)
public OnPlayerEnterDynamicRaceCP(playerid, checkpointid)