PDA

View Full Version : Problem.. [=+rep]


vassilis
08/03/2014, 03:08 PM
Long time to script so i try to remember a lot things so anyway here is my code... i cant remember whats wrong actually..


new gCopPlayer[MAX_PLAYERS]; // is this the mistake???

OnGameModeinit callback
gCopPlayer[0] = AddPlayerClass(165, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[1] = AddPlayerClass(166, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[2] = AddPlayerClass(280, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[3] = AddPlayerClass(281, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[4] = AddPlayerClass(282, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[5] = AddPlayerClass(283, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[6] = AddPlayerClass(284, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[7] = AddPlayerClass(285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[8] = AddPlayerClass(286, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[9] = AddPlayerClass(287, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[10] = AddPlayerClass(288, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[11] = AddPlayerClass(163, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[12] = AddPlayerClass(164, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);

public OnPlayerRequestClass(playerid, classid)
{

if(classid == gCopPlayer[classid])
{
SetPlayerPos(playerid, 293.108734, 182.532150, 1007.171875);
SetPlayerFacingAngle(playerid, 121.455261);
SetPlayerCameraLookAt(playerid, 293.108734, 182.532150, 1007.171875);
SetPlayerCameraPos(playerid, 293.108734 + (10 * floatsin(-121.455261, degrees)), 182.532150 + (10 * floatcos(-121.455261, degrees)), 1007.171875);
}
return 1;
}
errors :

(340) : error 010: invalid function or declaration
(415) : error 025: function heading differs from prototype
(420) : error 025: function heading differs from prototype


The lines that claims there are errors..(there is no error actually here) :
// line 340
public OnPlayerStateChange(playerid, state, oldstate)
{
return 1;
}
//line 415,420

public OnPlayerInteriorChange(playerid, interiorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, keys, oldkeys)
{
return 1;
}
So what am i actually doing wrong..

RenovanZ
08/03/2014, 03:11 PM
// line 340
public OnPlayerStateChange(playerid, state, oldstate)
{
return 1;
}
//line 415,420

public OnPlayerInteriorChange(playerid, interiorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, keys, oldkeys)
{
return 1;
}

Should be


// line 340
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
//line 415,420

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

Its because you have different parameters between your script and a_samp include.

vassilis
08/03/2014, 03:13 PM
oh ye thats the mistake indeed i had delete the "new" word by mistake using control + h to replace some functions thanks lad.. +rep for something a bit annoying lol

XK
08/03/2014, 03:16 PM
you forgot to add new :D

vassilis
08/03/2014, 03:19 PM
Ye he helped me but anyway when i go to other skin it doesnt change position of the area :/ is it wrong??
if(classid == gCopPlayer[classid])
{
SetPlayerPos(playerid, 293.108734, 182.532150, 1007.171875);
SetPlayerFacingAngle(playerid, 121.455261);
SetPlayerCameraLookAt(playerid, 293.108734, 182.532150, 1007.171875);
SetPlayerCameraPos(playerid, 293.108734 + (10 * floatsin(-121.455261, degrees)), 182.532150 + (10 * floatcos(-121.455261, degrees)), 1007.171875);
}
if(classid == gMedicPlayer[classid])
{
SetPlayerPos(playerid, 1681.180419, 2068.083740, 11.359375);
SetPlayerFacingAngle(playerid, 185.129440);
SetPlayerCameraLookAt(playerid, 1681.180419, 2068.083740, 11.359375);
SetPlayerCameraPos(playerid, 1681.180419 + (10 * floatsin(-185.129440, degrees)), 2068.083740 + (10 * floatcos(-185.129440, degrees)), 11.359375);
}


//Medics
gMedicPlayer[0] = AddPlayerClass(274, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gMedicPlayer[1] = AddPlayerClass(275, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gMedicPlayer[2] = AddPlayerClass(276, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
// Cops,Cia,Fbi
gCopPlayer[0] = AddPlayerClass(165, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[1] = AddPlayerClass(166, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[2] = AddPlayerClass(280, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[3] = AddPlayerClass(281, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[4] = AddPlayerClass(282, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[5] = AddPlayerClass(283, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[6] = AddPlayerClass(284, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[7] = AddPlayerClass(285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[8] = AddPlayerClass(286, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[9] = AddPlayerClass(287, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[10] = AddPlayerClass(288, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[11] = AddPlayerClass(163, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
gCopPlayer[12] = AddPlayerClass(164, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);

XK
08/03/2014, 03:30 PM
just delete gCopPlayer[numbers] all of them and lets say gcopplayer is the 4th skin ,then use:

if(classid == 4 && classid == 5 && classid == 6 classid == 7 & classid == 8 && classid == 6) // and put the others..
{
SetPlayerPos(playerid, 293.108734, 182.532150, 1007.171875);
SetPlayerFacingAngle(playerid, 121.455261);
SetPlayerCameraLookAt(playerid, 293.108734, 182.532150, 1007.171875);
SetPlayerCameraPos(playerid, 293.108734 + (10 * floatsin(-121.455261, degrees)), 182.532150 + (10 * floatcos(-121.455261, degrees)), 1007.171875);
}
if(classid == 1 && classid == 2 && classid == 3) //same
{
SetPlayerPos(playerid, 1681.180419, 2068.083740, 11.359375);
SetPlayerFacingAngle(playerid, 185.129440);
SetPlayerCameraLookAt(playerid, 1681.180419, 2068.083740, 11.359375);
SetPlayerCameraPos(playerid, 1681.180419 + (10 * floatsin(-185.129440, degrees)), 2068.083740 + (10 * floatcos(-185.129440, degrees)), 11.359375);
}

tell me if it works,because you didnt define classid for the ids i think

vassilis
08/03/2014, 03:47 PM
no ... it compiles i deleted what you told me but it doesnt show me now even the skin selection just the sky of los santos like when connecting