All pastes #417324 Raw Edit

Anonymous

public cpp v1 · immutable
#417324 ·published 2007-03-30 20:25 UTC
rendered paste body
#include <a_samp>new candocommand[MAX_PLAYERS];main(){	print("\n----------------------------------");	print(" By K3v1n");	print("----------------------------------\n");}public OnGameModeInit(){	print("GameModeInit()");	SetGameModeText("");	return 1;}public OnPlayerRequestClass(playerid,classid){	printf("OnPlayerRequestClass(%d,%d)",playerid,classid);	SetPlayerFacingAngle(playerid,);	SetPlayerPos(playerid,);	SetPlayerCameraPos(playerid,);	SetPlayerCameraLookAt(playerid,);	return 1;}public OnGameModeExit(){	print("GameModeExit()");	return 1;}public OnPlayerConnect(playerid){	printf("OnPlayerConnect(%d)",playerid);	if(IsPlayerAdmin(playerid)) {	    GameTextForAll("A new ~r~admin~w~ is here.",5000,5);	}	else {		GameTextForAll("A new ~r~player~w~ is here.",5000,5);	}	return 1;}public OnPlayerDisconnect(playerid){	printf("OnPlayerDisconnect(%d)",playerid);	if(IsPlayerAdmin(playerid)) {	    GameTextForAll("An ~r~admin~w~ has just left.",5000,5);	}	else {		GameTextForAll("A ~r~player~w~ has just left.",5000,5);	}	return 1;}public OnPlayerSpawn(playerid){	printf("OnPlayerSpawn(%d)",playerid);	return 1;}public OnPlayerDeath(playerid,killerid,reason){	printf("OnPlayerDeath(%d,%d,%d)",playerid,killerid,reason);	SendDeathMessage(killerid,playerid,reason);	return 1;}public OnVehicleSpawn(vehicleid){	printf("OnVehicleSpawn(%d)",vehicleid);	return 1;}public OnVehicleDeath(vehicleid,killerid){	printf("OnVehicleDeath(%d,%d)",vehicleid,killerid);	return 1;}public OnPlayerText(playerid){	printf("OnPlayerText(%d)",playerid);	return 1;}public OnPlayerCommandText(playerid,cmdtext[]){    new cmd[256];    new idx;    cmd = strtok(cmdtext,idx);	if (strcmp(cmd,"/dj",true)==0)	{	    if(candocommand[playerid]==0) {		    SendClientMessage(playerid,0xFFFF00AA,"You will have to wait longer before spawning the checkpoint.");	    }	    	    else {	        candocommand[playerid] = 0;			SetPlayerCheckpoint(playerid,x,y,z,10);		}	    return 1;	}	return 0;}public OnPlayerInfoChange(playerid){	printf("OnPlayerInfoChange(%d)");	return 1;}public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger){	printf("OnPlayerEnterVehicle(%d,%d,%d)",playerid,vehicleid,ispassenger);	return 1;}public OnPlayerExitVehicle(playerid,vehicleid){	printf("OnPlayerExitVehicle(%d,%d)",playerid,vehicleid);	return 1;}public OnPlayerStateChange(playerid,newstate,oldstate){	printf("OnPlayerStateChange(%d,%d,%d)",playerid,newstate,oldstate);	return 1;}public OnPlayerEnterCheckpoint(playerid){	printf("OnPlayerEnterCheckpoint(%d)",playerid);	SetTimer("disapearcheckpoint",300000,0);	SetTimer("playerearnmoney",1000,0);	return 1;}public disapearcheckpoint(playerid){	DisablePlayerCheckpoint(playerid);	SetTimer("enablecommandagain",300000,0);}public playerearnmoney(playerid){	if(IsPlayerInCheckpoint(playerid)) {		GivePlayerMoney(playerid,1);		SetTimer("playerearnmoney",1000,0);	}}public enablecommandagain(playerid){    candocommand[playerid] = 1;}public OnPlayerLeaveCheckpoint(playerid){	printf("OnPlayerLeaveCheckpoint(%d)",playerid);	return 1;}strtok(const string[],&index){	new length = strlen(string);	while ((index < length) && (string[index] <= ' '))	{		index++;	}	new offset = index;	new result[20];	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))	{		result[index - offset] = string[index];		index++;	}	result[index - offset] = EOS;	return result;}/*strtokspace(const string[],&index){	new length = strlen(string);	while ((index < length) && (string[index] <= ' '))	{		index++;	}	new offset = index;	new result[256];	while ((index < length) && ((index - offset) < (sizeof(result) - 1)))	{		result[index - offset] = string[index];		index++;	}	result[index - offset] = EOS;	return result;}*/