2 teleport commands in one gamemode not working
#1

Hi everyone when I write this code in pawn
http://i.imgur.com/ryf2pMy.png


It gives me 1 warning which says this
http://i.imgur.com/wjJoAww.png

Can anyone please tell me how can I delete this warning and what do I need to change in the code?

Here is the code for you to copy and paste

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/sky", cmdtext, true, )
{
SetPlayerPos(playerid, 4132.2002,-1846.2002,2.5);
SetPlayerInterior(playerid, 0);
return 1;
}
return 0;

if(!strcmp("/markhoss", cmdtext, true, )
{
SetPlayerPos(playerid, 1435.4,1208.9,643);
SetPlayerInterior(playerid, 0);
return 1;
}
return 0;
}

(I am sorry about the smilies in the code that's why I used the pictures instead)
Reply
#2

Well the warnings already tells you that the code at line 1296 is unreachable
The reason for that is always a wrong placed return

=> Remove the first return 0; statment
Reply
#3

Thank you so much it worked I never understood returns now I hopefully will
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)