errors
#1

Ok ive got a few errors and would be great if someone could helpill start with the first few then go onto the rest as they a bit spread about here is the first on


Код:
public OnPlayerSpawn(playerid)
{
    new Random = random(sizeof(MdmSpawns));
    new r = random(sizeof(RandomPistol));
    new r1 = random(sizeof(RandomAssault));
    new r2 = random(sizeof(RandomHeavy));
    new r3 = random(sizeof(RandomSub));
    if(MDM[playerid] != 0) {
   	    SetPlayerPos(playerid, MdmSpawns[Random][0], MdmSpawns[Random][1], MdmSpawns[Random][2]);
        GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
        GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
        GivePlayerWeapon(playerid, RandomHeavy[r2][0], RandomHeavy[r2][1]);
        Freeze(playerid, 5000);
    }
    if(WTF[playerid] != 0;//382
	SetPlayerPos(playerid, WtfSpawns[Random][0], WtfSpawns[Random][1], WtfSpawns[Random][2]);
	GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
 	GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
  	GivePlayerWeapon(playerid, RandomSub[r3][0], RandomSub[r3][1]);
	Freeze(playerid, 5000);
    else {//388
        SetPlayerPos(playerid, 405.7959, 2436.9858, 16.5000), SetPlayerInterior(playerid, 0);
    }
    return 1;
}
Код:
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(382) : error 001: expected token: ")", but found ";"
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(382) : error 036: empty statement
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(388) : error 029: invalid expression, assumed zero
Second lot had this before but cant remember what i done wrong lol there warning but ones that need fixing.

Код:
new WtfSpawns[19][3] = {//178
    {2796.0310,5115.2124,33.2604},
    {2788.4160,4949.3735,16.6528},
    {2882.0957,4950.8389,31.5787},
    {2789.2773,5000.6421,15.2726},
    {2865.3577,4956.7563,14.4105},
    {2843.2036,4964.4531,9.8290},
    {2803.5474,4953.8428,9.8290},
    {2804.0698,4957.8193,9.8290},
    {2785.4670,4939.6377,16.3765},
    {2788.4033,4949.2920,16.6528},
    {2799.2397,4988.4355,15.2726},
    {2777.0896,5016.3462,14.1376},
    {2774.7786,5049.4385,16.8952},
    {2796.4375,5107.6763,25.3056},
    {2794.3215,5101.8052,33.2089},
    {2848.1265,5116.3066,49.0261},
    {2903.1414,5117.0840,19.9178},
    {2908.1658,5100.4316,21.8698},
    {2905.4446,5077.5786,17.4287}
};//198
Код:
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(179) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(179) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(179) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(180) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(180) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(180) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(181) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(181) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(181) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(182) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(182) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(182) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(183) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(183) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(183) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(184) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(184) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(184) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(185) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(185) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(185) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(186) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(186) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(186) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(187) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(187) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(187) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(188) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(188) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(188) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(189) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(189) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(189) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(190) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(190) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(190) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(191) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(191) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(191) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(192) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(192) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(192) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(193) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(193) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(193) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(194) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(194) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(194) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(195) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(195) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(195) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(196) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(196) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(196) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(197) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(197) : warning 213: tag mismatch
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(197) : warning 213: tag mismatch
Код:
CMD:wtf(playerid)
{
	new Random = random(sizeof(MdmSpawns));
	new r = random(sizeof(RandomPistol));
    new r1 = random(sizeof(RandomAssault));
    new r3 = random(sizeof(RandomSub));
	DeathMatch[playerid] = 1;
	Wtf[playerid] = 1;//1116
	SetPlayerPos(playerid, WtfSpawns[Random][0], WtfSpawns[Random][1], WtfSpawns[Random][2]);
	GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
 	GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
  	GivePlayerWeapon(playerid, RandomSub[r3][0], RandomSub[r3][1]);
	Freeze(playerid, 5000);
	return 1;
}
Код:
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1116) : error 017: undefined symbol "Wtf"
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1116) : warning 215: expression has no effect
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1116) : error 001: expected token: ";", but found "]"
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1116) : error 029: invalid expression, assumed zero
C:\Users\GTA ONLY\My Samp Server\gamemodes\MySQL.pwn(1116) : fatal error 107: too many error messages on one line
Any help even with one would be great manythanks.
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
    new Random = random(sizeof(MdmSpawns));
    new r = random(sizeof(RandomPistol));
    new r1 = random(sizeof(RandomAssault));
    new r2 = random(sizeof(RandomHeavy));
    new r3 = random(sizeof(RandomSub));
    if(MDM[playerid] != 0) {
        SetPlayerPos(playerid, MdmSpawns[Random][0], MdmSpawns[Random][1], MdmSpawns[Random][2]);
        GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
        GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
        GivePlayerWeapon(playerid, RandomHeavy[r2][0], RandomHeavy[r2][1]);
        Freeze(playerid, 5000);
    }
    if(WTF[playerid] != 0);//382
    SetPlayerPos(playerid, WtfSpawns[Random][0], WtfSpawns[Random][1], WtfSpawns[Random][2]);
    GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
    GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
    GivePlayerWeapon(playerid, RandomSub[r3][0], RandomSub[r3][1]);
    Freeze(playerid, 5000);
    else {//388
        SetPlayerPos(playerid, 405.7959, 2436.9858, 16.5000), SetPlayerInterior(playerid, 0);
    }
    return 1;
}
pawn Код:
Wtf[playerid] = 1;//1116
Do you have it in variable?
Reply
#3

I have it in a stock

Код:
stock WTFDeath(playerid)
	{
	if WTF[playerid] = 1;
	Freeze(playerid, 5000);
 // whatever it might look like for you
	return SetPlayerPos(playerid, WtfSpawns[Random][0], WtfSpawns[Random][1], WtfSpawns[Random][2]);
 	new r = random(sizeof(RandomPistol));
	GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
	new r1 = random(sizeof(RandomAssault));
	GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
	new r3 = random(sizeof(RandomSub));
	GivePlayerWeapon(playerid, RandomSub[r3][0], RandomSub[r3][1]);
	false;
	return true;
}
Reply
#4

pawn Код:
public OnPlayerSpawn(playerid)
{
    new Random = random(sizeof(MdmSpawns));
    new r = random(sizeof(RandomPistol));
    new r1 = random(sizeof(RandomAssault));
    new r2 = random(sizeof(RandomHeavy));
    new r3 = random(sizeof(RandomSub));
    if(MDM[playerid] != 0) {
        SetPlayerPos(playerid, MdmSpawns[Random][0], MdmSpawns[Random][1], MdmSpawns[Random][2]);
        GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
        GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
        GivePlayerWeapon(playerid, RandomHeavy[r2][0], RandomHeavy[r2][1]);
        Freeze(playerid, 5000);
    }
    if(WTF[playerid] != 0) // You added a ; to an if instead ) and forgot the {
    {
    SetPlayerPos(playerid, WtfSpawns[Random][0], WtfSpawns[Random][1], WtfSpawns[Random][2]);
    GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
    GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
    GivePlayerWeapon(playerid, RandomSub[r3][0], RandomSub[r3][1]);
    Freeze(playerid, 5000);
    }
    else { //not sure but the fix above might fix this as well
        SetPlayerPos(playerid, 405.7959, 2436.9858, 16.5000), SetPlayerInterior(playerid, 0);
    }
    return 1;
}

pawn Код:
new Float:WtfSpawns[19][3] = { //You added floats down there without using Float: here
    {2796.0310,5115.2124,33.2604},
    {2788.4160,4949.3735,16.6528},
    {2882.0957,4950.8389,31.5787},
    {2789.2773,5000.6421,15.2726},
    {2865.3577,4956.7563,14.4105},
    {2843.2036,4964.4531,9.8290},
    {2803.5474,4953.8428,9.8290},
    {2804.0698,4957.8193,9.8290},
    {2785.4670,4939.6377,16.3765},
    {2788.4033,4949.2920,16.6528},
    {2799.2397,4988.4355,15.2726},
    {2777.0896,5016.3462,14.1376},
    {2774.7786,5049.4385,16.8952},
    {2796.4375,5107.6763,25.3056},
    {2794.3215,5101.8052,33.2089},
    {2848.1265,5116.3066,49.0261},
    {2903.1414,5117.0840,19.9178},
    {2908.1658,5100.4316,21.8698},
    {2905.4446,5077.5786,17.4287}
};

pawn Код:
CMD:wtf(playerid)
{
    new Random = random(sizeof(MdmSpawns));
    new r = random(sizeof(RandomPistol));
    new r1 = random(sizeof(RandomAssault));
    new r3 = random(sizeof(RandomSub));
    DeathMatch[playerid] = 1;
    Wtf[playerid] = 1; //well apparently Wtf[MAX_PLAYERS] isn't declared. Maybe it was WTF or wtf instead Wtf? (capitalisation is important)
    SetPlayerPos(playerid, WtfSpawns[Random][0], WtfSpawns[Random][1], WtfSpawns[Random][2]);
    GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
    GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
    GivePlayerWeapon(playerid, RandomSub[r3][0], RandomSub[r3][1]);
    Freeze(playerid, 5000);
    return 1;
}
Reply
#5

That was what i did last time with the Float now i remember lol thanks

Also thankyou both with my second error

and thanks Gust for the third error miss typed should have been WTF not Wtf
Reply
#6

got a bit of a bug now with onplayerspawn when you forst connect andspawn you spawn in the second dm insteadof the the last postion

Код:
public OnPlayerSpawn(playerid)
{
    new Random = random(sizeof(MdmSpawns));
    new r = random(sizeof(RandomPistol));
    new r1 = random(sizeof(RandomAssault));
    new r2 = random(sizeof(RandomHeavy));
    new r3 = random(sizeof(RandomSub));
    if(MDM[playerid] != 0) {
        SetPlayerPos(playerid, MdmSpawns[Random][0], MdmSpawns[Random][1], MdmSpawns[Random][2]);
        GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
        GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
        GivePlayerWeapon(playerid, RandomHeavy[r2][0], RandomHeavy[r2][1]);
        Freeze(playerid, 5000);
    }
    if(WTF[playerid] != 0) // You added a ; to an if instead ) and forgot the {
    {
    SetPlayerPos(playerid, WtfSpawns[Random][0], WtfSpawns[Random][1], WtfSpawns[Random][2]);
    GivePlayerWeapon(playerid, RandomPistol[r][0], RandomPistol[r][1]);
    GivePlayerWeapon(playerid, RandomAssault[r1][0], RandomAssault[r1][1]);
    GivePlayerWeapon(playerid, RandomSub[r3][0], RandomSub[r3][1]);
    Freeze(playerid, 5000);
    }
    else { //not sure but the fix above might fix this as well
        SetPlayerPos(playerid, 405.7959, 2436.9858, 16.5000), SetPlayerInterior(playerid, 0);
    }
    return 1;
}
Reply
#7

Isn't bug. You should save the player's position on OnPlayerDisconnect(playerid, reason)
Reply
#8

i do not mean there last postion i mean the the last bit in the code
Код:
 else { //not sure but the fix above might fix this as well
        SetPlayerPos(playerid, 405.7959, 2436.9858, 16.5000), SetPlayerInterior(playerid, 0);
    }
    return 1;
}
Reply
#9

fixed the problem didnt put some code in onplayerdisconnect and onplayerconnect
Reply
#10

Quote:
Originally Posted by manchestera
Посмотреть сообщение
i do not mean there last postion i mean the the last bit in the code
Oh Sorry then. I understood it wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)