SA-MP Forums Archive
Whats wrong in this code? +rep - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Whats wrong in this code? +rep (/showthread.php?tid=321973)



Whats wrong in this code? +rep - Dustly - 29.02.2012

Errors

C:\Users\Dust\Desktop\Samp server\gamemodes\bp.pwn(146) : warning 202: number of arguments does not match definition
C:\Users\Dust\Desktop\Samp server\gamemodes\bp.pwn(147) : error 001: expected token: "*then", but found "{"
C:\Users\Dust\Desktop\Samp server\gamemodes\bp.pwn(149) : warning 202: number of arguments does not match definition

Heres the code.

Quote:

public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);

if GetPlayerSkin(playerid, 287)
{
new rand = random(sizeof(RandomUSASpawn));
SetPlayerPos(playerid, RandomUSASpawn[rand][0],RandomUSASpawn[rand][1],RandomUSASpawn[rand][2],RandomUSASpawn[rand][3]);
}
return 1;
}

My array is set up correctly but I have No Damn idea whats the error highlighted in red is, or how to fix it.
JUST INCASE its my aray. Here it is.

Quote:

new Float:RandomUSASpawn[][4] =
{
{289.5552,1896.6105,17.6406,270.0378},
{289.5629,1885.3944,17.6406,267.6761},
{290.0782,1855.7422,17.6406,267.8445},
{291.0180,1850.6392,17.6406,271.2911},
{292.0120,1844.9946,17.6406,260.3243}
}




Re: Whats wrong in this code? +rep - emokidx - 29.02.2012

pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);
new skin;
skin = GetPlayerSkin(playerid); // GetPlayerSkin(playerid); no more arguments
if (skin == 287)
{
new rand = random(sizeof(RandomUSASpawn));
SetPlayerPos(playerid, RandomUSASpawn[rand][0],RandomUSASpawn[rand][1],RandomUSASpawn[rand][2]); // one extra argument , also, fix your random float.
}
return 1;
}



Re: Whats wrong in this code? +rep - Ricey - 29.02.2012

Hm, On the End of Your

Quote:

new Float:RandomUSASpawn[][4] =
{
{289.5552,1896.6105,17.6406,270.0378},
{289.5629,1885.3944,17.6406,267.6761},
{290.0782,1855.7422,17.6406,267.8445},
{291.0180,1850.6392,17.6406,271.2911},
{292.0120,1844.9946,17.6406,260.3243}
}

You May be Missing a ;.


Re: Whats wrong in this code? +rep - Dustly - 29.02.2012

Sometimes People on here make me feel as a dumbass. Thanks for the assistance, This has been halting my progress all night.

Now im getting somthing real strange on another note.
Quote:

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

Quote:

C:\Users\Dust\Desktop\Samp server\gamemodes\bp.pwn(19) : error 001: expected token: ";", but found "-identifier-"

I think I just solved it


Re: Whats wrong in this code? +rep - Ricey - 29.02.2012

Can you Show some Coding Below & Above?

Cheers,

As for the Dumbass, We Can only Learn from Mistakes, If Its not Pointed Out, There's Really no point in Learing.

Cheers, Ricey.