All pastes #121242 Raw Edit

Stuff

public text v1 · immutable
·published 2006-08-07 21:06 UTC
rendered paste body
if (strcmp(cmd, "/tvieta", true) == 0)	{
	    new vieta1[256],vieta2[256],temp[256],index2 = 0;
new Float:PlaceX = 0.0;
new Float:PlaceY = 0.0;
new Float:PlaceZ = 0.0;
		vieta1 = strtok(cmdtext, idx);

		if(!strlen(vieta1)) { SendClientMessage(playerid, COLOR_GREEN, "Use: /tvieta name"); return 1; }
		new File:fhandle;
		fhandle = fopen("places.txt",io_readwrite);
		while(fread(fhandle,temp,sizeof(temp),false)) {
		index2 = 0;
			vieta2 = strtok(temp,index2);
			if(strcmp(vieta2,vieta1,true) == 0) {
				PlaceX = strfloat(strtok(temp,index2));
				PlaceY = strfloat(strtok(temp,index2));
				PlaceZ = strfloat(strtok(temp,index2));
				SetPlayerPos(playerid,PlaceX,PlaceY,PlaceZ);
	    		SendClientMessage(playerid,COLOR_WHITE,"Teleported");

		}
		}
		fclose(fhandle);
	    return 1;
	}

if (strcmp(cmd, "/addpl", true) == 0) 	{
new Float:x, Float:y, Float:z;
 		if (IsPlayerAdmin(playerid) == 1) 		{
 	    	new place2[255];
 	    	place2 = strtok(cmdtext, idx);
 			if(!strlen(place2)) {
 			    SendClientMessage(playerid,COLOR_RED,"Usage: /addpl <place>");
 			    return 1;
 			} else {
 					new File: file2 = fopen("places.txt", io_append);
 					GetPlayerPos(playerid, x,y,z);
 					format(string,sizeof(string),"%s %f %f %f \r\n",place2,x,y,z);
 					fwrite(file2,string);
 					fclose(file2);
 				    SendClientMessage(playerid,COLOR_RED,string);
 				    return 1;
 				}

 			}
 		}