All pastes #276729 Raw Edit

Goto/

public text v1 · immutable
·published 2006-12-12 17:30 UTC
rendered paste body
	new gotocmd[256], gotoindex;
	gotocmd = strtok(cmdtext, gotoindex);
	
	if (strcmp(gotocmd, "/goto", true) ==0)
	{
	    new gotonum;
	    gotonum = strval(strtok(cmdtext, gotoindex));
	    
	    if(!strlen(gotocmd)){
	    SendInfMsg(playerid, "Type /gotolist 1 for places");
	    }

		new subgotocmd[256], subgotoindex;
		subgotocmd = strtok(cmdtext, subgotoindex);
		
		if (strcmp(subgotocmd, "/gotolist", true) ==0)
		{
		    new gotolistnum;
		    gotolistnum = strval(strtok(cmdtext, subgotoindex));
		    
 	    	if(gotolistnum == 1){
            SendInfMsg(playerid, "1. Place 1");
	    	SendInfMsg(playerid, "2. Place 2");
	    	SendInfMsg(playerid, "3. Place 3");
	    	SendInfMsg(playerid, "4. Place 4");
	    	SendInfMsg(playerid, "5. Place 5");
	    	SendInfMsg(playerid, "6. Place 6");
	    	SendInfMsg(playerid, "7. Place 7");
	    	SendInfMsg(playerid, "8. Place 8");
	    	SendInfMsg(playerid, "Type /gotolist 2 for list 2");
			}
		}

     	if (gotonum == 1)
		{
	    SetPlayerPos(playerid, 1886.2029,2339.5566,10.6016);
	    }
	    if (gotonum == 2)
		{
	    SetPlayerPos(playerid, 2452.3638,1240.0322,10.5474);
	    }
	    if (gotonum == 3)
		{
	    SetPlayerPos(playerid, 2002.3323,1544.4202,13.3141);
	    }
	    if (gotonum == 4)
		{
	    SetPlayerPos(playerid, -1400.2727,2643.7561,55.3724);
	    }
	    if (gotonum == 5)
		{
	    SetPlayerPos(playerid, -234.3362,2608.4287,62.3873);
	    }
	    if (gotonum == 6)
		{
	    SetPlayerPos(playerid, 2591.0447,1856.3821,10.5474);
	    }
	    if (gotonum == 7)
		{
	    SetPlayerPos(playerid, 2879.4023,2342.2673,10.5474);
	    }
	    if (gotonum == 8)
		{
	    SetPlayerPos(playerid, 1097,1961.8290,1593.4952);
	    }
		SendInfMsg(playerid, "You are teleported");
		return 1;
	}